aspose file tools*
The moose likes JSF and the fly likes Newbie selectOneListBox question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Newbie selectOneListBox question" Watch "Newbie selectOneListBox question" New topic
Author

Newbie selectOneListBox question

Ian Dunsirn
Ranch Hand

Joined: May 25, 2006
Posts: 36
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}"/>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie selectOneListBox question