The Problem
By the time the EL processor gets to that tag, it's already too late to decide to not build the UIComponent
instance that the tag is bound to i.e. once the EL processor gets to the <rich:dropDownMenu/>
, it's going to call getTextBlockMenu()
. The rendered
attribute is a view-render time flag that simply decides whether or not to show the component.
To Solve
The decision whether to build the component must be made during view-build using the <c:if/>
JSTL tag:
<a4j:region rendered="false">
<h:panelGroup rendered="false">
<c:if test="#{textBlockBean.renderCondition}">
<rich:dropDownMenu binding="#{textBlockBean.textBlockMenu}" rendered="false" />
</c:if>
</h:panelGroup>
</a4j:region>
Where renderCondition
is a backing bean flag that determines the availability of the component