I am not able to get the items in the selectoneItem dynamically
Here is my code:
<h:outputLabel for="branch">Branch</h:outputLabel> <h:selectOneMenu id="branch" value="#{stud.masterBranch}" > <s:selectItems var="branches" value="#{branchList}" noSelectionLabel="[Please Select]" label="# {branches.name}"/> <s:convertEntity /> <a4j:support event="onchange" reRender="listofsections" /> </h:selectOneMenu> <h:outputLabel for="section">Section</h:outputLabel> <h:selectOneMenu id="section" value="#{stud.masterSection}" > <s:selectItems id="listofsections" var="sections" value="#{sectionList}" noSelectionLabel="[Please Select]" label="#{sections.section}"/> <s:convertEntity /> </h:selectOneMenu>
When I choose Branch from the dropdown menu. It dont show the corresponding sections of that branch
Is there any error in my code?
On <a4j:support /> tag from Brach
you must execute the action responsable for load the corresponding Sections
.
Like this:
<a4j:support event="onchange" reRender="listofsections" action="#{yourAction.loadSectionsMethod}"/>