Monday, 15 July 2013

jsf - Manipulate component tree in restore view phase -



jsf - Manipulate component tree in restore view phase -

for web application (myfaces 2.2), need cut down component tree speed application. how can this?

given:

a composite component renders input elements due backing bean value

class="lang-xml prettyprint-override"><h:datatable value="#{mylist}" var="mybean"> <h:column> <h:inputtext ... rendered="#{mybean.myvalue == 1}" /> <h:selectonemenu ... rendered="#{mybean.myvalue == 2}">...</...> <h:inputtextarea ... rendered="#{mybean.myvalue == 3}" /> </h:column> </h:datatable>

problem:

all components appear in component tree, when rendered attribute false

inputtext selectonemenu inputtextarea

is possible forbid jsf build component tree 3 components? restore view phase doesn't know content of apply request values phase, of import able interpret still before.

if want accomplish behavior, seek utilize <c:if> tag instead of rendered atribute on jsf component

<c:if test="#{ mybean.myvalue == 1 }"> <h:inputtext .../> </c:if>

don't forget add together namespace definition

xmlns:c="http://java.sun.com/jstl/core"

jsf components

No comments:

Post a Comment