I am developing a JSF 2.0 application, where I have an xhtml page with 4 cascading drop-downs. The drop-downs gets populated from the database based on some queries. That works well! Now I need to clear/reset these drop-downs after my selections are done. When I come to this page for a second time, the drop-downs still remain populated. If I select from the first drop-down, the second drop-down gets refreshed, but not the third and fourth. The data in those still remains intact. Here is the code I am using. I am just showing the 3 drop-downs here, the fourth is similar. Any help/suggestions appreciated.
<label class="control-label">Dropdown1</label>
<div>
<h:selectOneMenu id="drop1" value="#{myBean.aId}">
<f:selectItem itemLabel="Select" itemValue="" />
<f:selectItems value="#{myBean.aList}" var ="a"
itemLabel="#{a.name}"
itemValue="#{a.id}" />
<p:ajax update="drop2" listener="#{myBean.populateDrop2}" />
</h:selectOneMenu>
</div>
<label class="control-label">Dropdown2</label>
<div>
<h:selectOneMenu id="drop2" value="#{myBean.bId}">
<f:selectItem itemLabel="Select" itemValue="" />
<f:selectItems value="#{myBean.bList}" var ="b"
itemLabel="#{b.name}"
itemValue="#{b.id}" />
<p:ajax update="drop3" listener="#{myBean.populateDrop3}" />
</h:selectOneMenu>
</div>
<label class="control-label">Dropdown3</label>
<div>
<h:selectOneMenu id="drop3" value="#{myBean.cId}">
<f:selectItem itemLabel="Select" itemValue="" />
<f:selectItems value="#{myBean.cList}" var ="c"
itemLabel="#{c.name}"
itemValue="#{c.id}" />
</h:selectOneMenu>
</div>