I have thought about this for a while – not getting a good idea.
This is the problem. I will have to display a text either in a text box or as an output text. How do I do this using a boolean variable in JSF?
I do not want to make an h:inputText and disable/make read only, it based on the boolean , I want to display a clean label or an output text.
suggestions ?
Make use of the
renderedattribute. It takes a boolean expression.If the expression evaluates
true, the component will be rendered in the component tree and be visible in the generated HTML output. If it evaluatesfalse, it will not be rendered and thus not be emitted to the HTML output.Here are several other examples how you could express a boolean expression.