Reputation:
I am using JSF 1.2 and I have the following output format:
<h:outputFormat value="#{txt.text_a}">
<f:param value="#{bean.get_a}" />
</h:outputFormat>
And I have also the following output text:
<h:outputText value="#{bean.get_b}" />
I would like to display them conditionally in an if-else case. In the backing bean, I have a boolean property visible
for that. How can I implement it in an if-else case?
Upvotes: 0
Views: 1131
Reputation: 11757
You could do it using two different blocks with the opposite rendered
condition, as follows:
<h:outputFormat value="#{txt.text_a}" rendered="#{visible}">
<f:param value="#{bean.get_a}" />
</h:outputFormat>
<h:outputText value="#{bean.get_b}" rendered="#{not visible}" />
Where visible
represents the condition for the text_a
to be displayed.
Upvotes: 1