Hi,
<h:form>
<h:panelGroup>
<h:inputText id="testId"
rendered="#{component.id eq 'testId'}"
value="#{bean.value}" />
</h:panelGroup>
</h:form>
please notice the expression:
rendered="#{component.id eq 'testId'}"
that is clearly true.
But that does not work as expected: inputText is rendered, but never
updates model value.
Problem 1.
from specification, methods UIComponent.process* and encode*
1) If the rendered property of this {@link UIComponent}
false, skip further processing
2) Call {@link #pushComponentToEL}
-> #{component} resolves in rendered="#{}" to parent!
Problem 2.
MyFaces implement that (pointless) requirement inconsistently: from
UIComponentBase.process*:
(!isRendered())
return;
pushComponentToEL(context, this)
and from UIComponentBase.encodeBegin*
pushComponentToEL(context, this);
if (isRendered())
causes that example above renderes inputText, but never updates model.
Problem 3.
RendererUtils.renderChild(FacesContext, UIComponent):
in this method it is unappropriate to use following code:
if (!child.isRendered()) {
return;
}
child.encodeBegin(facesContext);
because:
1) it does not take into account pushComponentToEL ( #{component}
resolves to parent)
2) behaviour is incosistent with UIComponent.encodeBegin : you'll get
"random" rendering - depends if parent of component renders it's
children or not! For this case I've created MYFACES-3126, but I'll
reopen it now, because simple remove of 'if (!child.isRendered())' does
not solve that problem and causes another problem if component
getRendersChildren = false;
What do yout think about this problem?
Regards,
Kočičák