Ajax update/render does not work on a component which has rendered attribute

It’s not possible to re-render (update) a component by ajax if the component itself is not rendered in first place. The component must be always rendered before ajax can re-render it. Ajax is using JavaScript document.getElementById() to find the component which needs to be updated. But if JSF hasn’t rendered the component in first place, … Read more

Conditionally displaying JSF components

Yes, use the rendered attribute. <h:form rendered=”#{some boolean condition}”> You usually tie it to the model rather than letting the model grab the component and manipulate it. E.g. <h:form rendered=”#{bean.booleanValue}” /> <h:form rendered=”#{bean.intValue gt 10}” /> <h:form rendered=”#{bean.objectValue eq null}” /> <h:form rendered=”#{bean.stringValue ne ‘someValue’}” /> <h:form rendered=”#{not empty bean.collectionValue}” /> <h:form rendered=”#{not bean.booleanValue and … Read more