Is EL-parsing of children to elements with rendered="false" really supposed to be evaluated? This is causing me alot of trouble with null pointer exceptions and similar. Looking at 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 issue (besides performance) is that xdin:competenceTable
does not support a null tree
-attribute. getTreeName(int index)
returns null in this case, and is followed by a call to getCompetenceTree(3)
which returns null, even though its parent (p:tab
) has rendered="false"
In short: xdin:competenceTable
is parsed by EL even though it's parent has rendered="false"
. Why?
Take a look at the JSF lifecylce below.
Rendering is only the last phase, and rendered="false"
only affects that last phase, while errors in constructing a component happen in the first.
Non-rendered components should in fact not do anything during all phases, but it looks as though your component does not conform to that part of the spec.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With