JSF provided a question

Are EL parsing elements with rendered = "false" that really need to be evaluated? This causes me a lot of problems with exceptions and null pointer errors. Seeing the following example:

<p:tab title="#{userCompetenceController.getTreeName(3)}" rendered="#{!empty userCompetenceController.getTreeName(3)}">
  <xdin:competenceTable id="competenceBox3"
                        profile="#{userCompetenceController.selectedProfile}"
                        tree="#{userCompetenceController.getCompetenceTree(3)}"
                        maxHeight="500px"/>
</p:tab>

The main problem (besides performance) is that it xdin:competenceTabledoes not support the null attribute tree. getTreeName(int index)returns null in this case, followed by a call getCompetenceTree(3)that returns null, even if its parent ( p:tab) hasrendered="false"

In short: xdin:competenceTableEL is analyzed, although the parent does rendered="false". Why?

+5
source share
1 answer

Take a look at the JSF lifecylce below.

- , rendered="false" , .

, , .

enter image description here

+3

All Articles