I have four dependent dropdown boxes A, Layout, Farm and D. Each of which is showing list of data depending on the previous dropdown box selected value. If I select a value in dropdown box Layout all the data related to Layout is fetched from database and displayed in Farm dropdown. The default value for all the dropdown boxes is select-one. If I select a option in one dropdown box automatically the next dropdown box is showing select-one as default.
But in the third dropdown box Farm, I have an option All. If I select 'All' in Farm, go back to Layout dropdown and select a different option, the dropdown box Farm is not changing to select-one as default value. It is showing All as default value but I want select-one. Can anybody help me how to display select-one as default value instead of 'All'.
<p:column>
<p:selectOneMenu id="laylist" value="#{imageBean.selectedlayoutid}">
<f:selectItem itemValue="0" itemLabel="select-one" noSelectionOption="true"/>
<f:selectItems value="#{imageBean.layoutids}" var="lay" itemLabel="#{lay.layoutname}" itemValue="#{lay.layoutid}"/>
<p:ajax update="farlist"/>
</p:selectOneMenu>
</p:column>
<p:column>
<p:selectOneMenu id="farlist" value="#{imageBean.selectedfarmid}">
<f:selectItem itemLabel="select-one" itemValue="" noSelectionOption="true" />
<f:selectItem itemValue="allfarm" itemLabel="All" />
<f:selectItems value="#{imageBean.farms}" var="far" itemLabel="#{far.farmname}" itemValue="#{far.farmid}"/>
<p:ajax update="mplist" />
</p:selectOneMenu>
</p:column>