jsf - How do I change the second dropdown based on value changes from first dropdown using a4j? -
i using 2 dropdowns in jsf. need use a4j richfaces ajax call only. based on value change in 1st dropdown, have change display 2nd dropdown.
first dropdown having values: dc, rc , ab. in 2nd dropdpwn:
if value in dropdown 1 dc, change value in selectitem dc related subjects. ( have built list of subjects dc)
similarly if value in dropddown 2 rc, change value in selectitem dc related subjects. ( have built list of subjects dc)
if not dc or rc, show dropdpwn null values.
dropdown 1:
<h:selectonemenu id="skillsetarea" valuechangelistener="#{mybean.changeskillset}" value="#{mybean.skillset}"> <f:selectitem itemlabel=" " itemvalue="" /> <f:selectitems value="#{referencebean.skillsetcodes}" /> <a4j:support event="onchange" ajaxsingle="true"/> </h:selectonemenu>
dropdown 2:
<h:selectonemenu id="subjects" value="#{demobean.subjectcode}" disabled="#{demobean.showsubject}"> <f:selectitem itemlabel=" " itemvalue="" /> <f:selectitems value="#{demobean.showsubejctfordc}" /> </h:selectonemenu>
Comments
Post a Comment