posted 16 years ago
I have a page that has a listbox and a reset button. The reset button is supposed to set the data back to the values it had when the page first loaded. When I pick a value off the listbox, that value stays in the "selected" area of the box, but when I hit the reset button, the "selected" value reverts to the first item in the listbox. Is there some way to hold on to the selected value when I press the reset button?
Code is below.
<h:selectOneListbox id="uiSelectionField" size="1"
valueChangeListener="#{projectListener.listuiSelections}"
onchange="this.form.submit()" immediate="true">
<f:selectItem itemValue="IssueStatus" itemLabel="Status"/> <f:selectItem itemValue="IssueEnvironment" itemLabel="Environment"/> <f:selectItem itemValue="IssuePriority" itemLabel="Priority"/>
<f:selectItem itemValue="IssueRelease" itemLabel="Release"/>
<f:selectItem itemValue="IssueType" itemLabel="Issue Type"/>
<f:selectItem itemValue="IssueFunction" itemLabel="Function"/>
<f:selectItem itemValue="IssueModule" itemLabel="Module"/>
</h:selectOneListbox>
.
.
some omitted code
.
.
<h:commandButton value="Reset" action="#{projectListener.listuiSelections}"/>