facelets

facelets: passing bean name with ui:param to action attribute

老子叫甜甜 提交于 2019-12-19 04:21:52
问题 Due to some custom components which expect a bean name (NOT the bean instance) in their attributes I need to pass the actual bean name between pages. As the bean itself is also used by non-custom components, I would like to avoid using additional ui:param (like described here Passing action in <rich:modalPanel>) since it will essentially specify the same bean. Is it possible to specify component's action using bean name provided with ui:param ? Basically I am trying to achieve the following:

DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled.

江枫思渺然 提交于 2019-12-18 12:05:42
问题 I'm trying to create a DataTable with Multiple Row Selection but i'm getting an error here's the link of the tutorial http://www.primefaces.org/showcase/ui/datatableRowSelectionMultiple.jsf : Here's my xhtml: <p:dataTable border="1" value="#{projectAdminisrationMB.projectNoUsersList}" var="userObj" selection="# {projectAdminisrationMB.selectedUsers}" selectionMode="multiple" rowIndexVar="rowIndex"binding="#{table2}"> <p:column id="column3"> <f:facet name="header"> <h:outputText value=" user "

<c:if test> seems to always evaluate true in JSF2 Facelets

女生的网名这么多〃 提交于 2019-12-18 11:12:45
问题 I am using JSF2 on Facelets. I define an <ui:param> in a page: <ui:composition template="/WEB-INF/templates/ui.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" > <ui:param name="title" value="OnAir WebDemo" /> ... </ui:composition> in the ui.xhtml template I have: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf

Does Facelets rebuild the whole page if Ajax is trigger from a form and updates another?

我是研究僧i 提交于 2019-12-18 09:45:18
问题 Setup: I have 2 forms A & B I have a commandLink in form A: <h:commandLink actionListener="#{homeView.selectDiv('homeUpdates')}">#{msg.homeUpdates} <f:ajax render=":B" execute="@this" /> </h:commandLink> ...which updates form B. The problem is that when I click the ajax link, it rebuilds form A as well and gets an exception from a ui:repeat I have. Is this correct behaviour? Should it rebuild form A as well? I am using JSF 2.2 and form A contains a ui:fragment=>ui:include=>ui:repeat ====

Dynamically added input field in ui:repeat is not processed during form submit

ε祈祈猫儿з 提交于 2019-12-18 09:08:37
问题 I am trying to make a input form for answers in my application and I start with four "empty" answers which the view loops over and make input fields for. I have an add answer button which I add one question to the array of answers and then the view render the answers again, but now with an additional input field. The backing bean is viewscoped. However if I submit the form without pressing the add answer button it all works. The data is saved in the database. But if I add an answer after the

How to iterate a HashMap with primefaces selectable datatable

拜拜、爱过 提交于 2019-12-18 08:57:00
问题 I have tried different solutions but none is working in my case. I want all the rows in this datatable to be selectable. The problem seems to be the <ui:repeat that is probably overriding the objects... My bean: @ManagedBean @ViewScoped public class Chat { private static Map<String, List<ChatObject>> chat = new LinkedHashMap<String, List<ChatObject>>(); private ChatObject selectedChatObject; public void onChatRowSelection(){ if(getSelectedChatObject() != null){ System.out.println("test"); } }

Custom FaceletFactory in JSF 2.2 / Alternatives for virtual host facelets

。_饼干妹妹 提交于 2019-12-18 08:56:22
问题 Since Mojarra/JSF 2.2. it is not possible anymore to provide a custom FaceletFactory using a web.xml context parameter: <context-param> <param-name>com.sun.faces.faceletFactory</param-name> <param-value>my.faces.overrides.MyFaceletFactory</param-value> </context-param> My application provides some CMS features, including virtual host support to serve different pages (facelets) based on the currently requested domain. So http://www.domain1.com/index.xhtml returns different content than http:/

Integrating JSTL With Facelets

a 夏天 提交于 2019-12-18 06:48:28
问题 I am considering using Facelets and JSTL in the same web project. Are there any issues in integrating these ? 回答1: Facelets has cloned a limited set of "good old" JSTL tags and included in the Facelets library. They are all described here. In other words: not all JSTL tags/functions are supported in Facelets. If there's any original JSTL tag which you would like to use, but isn't made available by Facelets, then you'll head in another corner for the solution. The jobs which can be done by the

Test if ui:insert has been defined in the template client

99封情书 提交于 2019-12-18 04:39:18
问题 I am wondering if it is possible to know if ui:insert was defined in the ui:composition . I know that I can do it using separate ui:param , but just wanted to do it without in order to keep it simple and less error prone. Example : Template ... <ui:insert name="sidebar" /> <!-- Conditionnaly set the class according if sidebar is present or not --> <div class="#{sidebar is defined ? 'with-sidebar' : 'without-sidebar'}"> <ui:insert name="page-content" /> </div> ... Page 1 ... <ui:define name=

h:commandButton is not working once I wrap it in a <h:panelGroup rendered>

坚强是说给别人听的谎言 提交于 2019-12-17 20:26:36
问题 The reason why the topic has "kind of" is because I have an example in JSF 2.2 where I use a commandButton and call a bean function twice (depending on the url). It's basically the same code, which executes only in one example. Here's the code with the description of the "error" below the code: User bean @ManagedBean @RequestScoped public class User { private String name; private String surname; private int age; private int id; public String getName() { return name; } public void setName