rendered-attribute

JSF: why is empty test in rendered invoked during apply request values phase during form submission under request scoped POST REDIRECT GET

我是研究僧i 提交于 2019-12-22 16:30:45
问题 This question is spawned from the partial answer to JSF2: why does empty test in rendered of panelGroup in composite prevent action from being called? In the following an Element is an @Entity with a name and id. A view.xhtml JSF page takes the id as a viewParam and uses setID(Long id) of the @ManagedBean @RequestScoped ElementController to trigger loading of the corresponding Element by id from database (that plays no further role in the question) and this found Element is set as the

What is the correct way to use RequestScoped Bean and rendered attribute?

一曲冷凌霜 提交于 2019-12-20 06:48:25
问题 does anybody know how to use RequestScoped bean together with rendered attribute in jsf? The rendered attribute is evaluated before applyValues phase and therefore is not correctly evaluated. I don't want to preserve any state. The example could be an outputPanel with a datatable and a button. The datatable gets a list of values. The wrapping outputPanel has the rendered attribute like: <p:outputPanel rendered="#{not empty requestScopedBean.dataList}"> <p:datatable value="#{requestScopedBean

<a jsf:rendered=“#{…}”> is not interpreted as passthrough element

梦想与她 提交于 2019-12-19 09:05:49
问题 I don't understand why this piece of code is working: <h:link value="Login" rendered="#{sessionBean.userInSessionBean == null}" /> and this piece of code is not working: <a jsf:rendered="#{sessionBean.userInSessionBean == null}">Login</a> 回答1: A HTML element will only become a passthrough element if following conditions are met: There's at least one jsf:xxx attribute from http://xmlns.jcp.org/jsf namespace. There's at least one "identifying attribute" associated with a specific JSF component.

JSF Conditional includes, cause Component ID has already been found in the view

岁酱吖の 提交于 2019-12-17 19:08:02
问题 I know we can't repeat the ID of any component we have in the same view tree. I have a page which includes another pages by certain condition Like this... <h:panelGroup rendered="#{bean.insertMode == 'SINGLE'}"> <ui:include src="_single.xhtml" /> </h:panelGroup> <h:panelGroup rendered="#{bean.insertMode == 'DOUBLE'}"> <ui:include src="_double.xhtml" /> </h:panelGroup> Now In these pages I have "Almost" the same components hierarchy (Complex) with different actions behaviour (Not only method

Although rendered=“false”, content of a h:dataTable is always evaluated

两盒软妹~` 提交于 2019-12-12 14:07:48
问题 I have got a problem with the HtmlDataTable of JSF 2.0. On my web page, i have got a h:dataTable and some other content, which should only be rendered if the user is logged in. The content of the HtmlDataTable is loaded from a database. Although the h:dataTable is not rendered when the user is not logged in, the content is still evaluated. Here is the code of the web page: <h:panelGroup rendered="#{userBean.loggedIn}"> <h:dataTable value="#{xxxBean.allXxx}" var="c"> <h:column> <h:outputText

How come JSF 2.x with EL 2.2 allows MethodExpression in place for ValueExpression?

萝らか妹 提交于 2019-12-07 22:18:53
问题 I am seeing several questions asking how to pass parameters to JSF methods. With EL2.2 and servlet 3.0, it enables user to pass parameters into a method call. One example: How to pass an argument to method from rendered h:outputText? The question is: In JSF 2.x, each tag attribute is supposed to take either ValueExpression or MethodExpression. In the linked example, "rendered" is supposed to only take ValueExpression. However I do see it still works with MethodExpression if we put () to make

JSF: why is empty test in rendered invoked during apply request values phase during form submission under request scoped POST REDIRECT GET

核能气质少年 提交于 2019-12-06 09:39:34
This question is spawned from the partial answer to JSF2: why does empty test in rendered of panelGroup in composite prevent action from being called? In the following an Element is an @Entity with a name and id. A view.xhtml JSF page takes the id as a viewParam and uses setID(Long id) of the @ManagedBean @RequestScoped ElementController to trigger loading of the corresponding Element by id from database (that plays no further role in the question) and this found Element is set as the 'current' Element available (for historical reasons by a slightly different name) as Element getSelected().

What is the correct way to use RequestScoped Bean and rendered attribute?

核能气质少年 提交于 2019-12-02 09:53:53
does anybody know how to use RequestScoped bean together with rendered attribute in jsf? The rendered attribute is evaluated before applyValues phase and therefore is not correctly evaluated. I don't want to preserve any state. The example could be an outputPanel with a datatable and a button. The datatable gets a list of values. The wrapping outputPanel has the rendered attribute like: <p:outputPanel rendered="#{not empty requestScopedBean.dataList}"> <p:datatable value="#{requestScopedBean.dataList}"> ... </p:datatable> <p:commandButton action="#{requestScopedBean.someAction}" /> </p

JSF Conditional includes, cause Component ID has already been found in the view

别说谁变了你拦得住时间么 提交于 2019-11-28 09:41:27
I know we can't repeat the ID of any component we have in the same view tree. I have a page which includes another pages by certain condition Like this... <h:panelGroup rendered="#{bean.insertMode == 'SINGLE'}"> <ui:include src="_single.xhtml" /> </h:panelGroup> <h:panelGroup rendered="#{bean.insertMode == 'DOUBLE'}"> <ui:include src="_double.xhtml" /> </h:panelGroup> Now In these pages I have "Almost" the same components hierarchy (Complex) with different actions behaviour (Not only method calls, also view), for example: _single.xhtml <p:inputText id="fieldID" value="#{bean.value}" /> <p

javax.el.PropertyNotFoundException when submitting ui:repeat with conditionally rendered properties of different subclasses

穿精又带淫゛_ 提交于 2019-11-28 09:31:48
In my backing-bean I have a collection of objects of different subclasses sharing a common interface. Inside the view, an ui:repeat iterates over this collection. Inside this loop, different properties have to be rendered depending on the concrete implementation of the interface. I reduced the problem to the following backing bean: @Named @SessionScoped public class DummyBean implements Serializable { private List<Type> objects = new ArrayList<Type>(); public void add1() { objects.add(new Type1()); } public void add2() { objects.add(new Type2()); } public void remove(Type o) { objects.remove(o