How to conditionally render an f:selectItem tag?

The <f:selectItem> does not support the rendered attribute. Your closest bet is the itemDisabled attribute which still displays the item, but makes it unselectable. This is also supported in <f:selectItems>. In case of <p:selectOneMenu> you can then just add some CSS to hide disabled items. <p:selectOneMenu … panelStyleClass=”hideDisabled”> <f:selectItem itemValue=”1″ itemLabel=”one” /> <f:selectItem itemValue=”2″ itemLabel=”two” … Read more

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