3 Replies Latest reply on Dec 17, 2007 9:03 AM by damonchong

    How to retain selected value in dropdown list...

    damonchong

      First and foremost, thanks for any assistance and advice!

      I have created a drop down box as below:

      <h:selectOneMenu id="orgTypeSelect" value="#{addStrainCtrl.organism}" required="true">
       <s:selectItems value="#{organismTypes.resultList}" var="organismType" label="#{organismType.description}" noSelectionLabel="Please Select..." />
       <s:convertEntity />
      </h:selectOneMenu>
      


      However, I realise if there is any errors during the processing of the submitted form and the user is re-directed to the same form for a chance to correct their "mistakes", the value they selected in the drop down box is reset to "Please Select...". This behaviour is not happening for input text box using the <h:inputText> tag though.

      I cracked my brain for a few days now trying to figure out the missing ingredient...it shouldn't be something extremely difficult, i hope ;-)

      Appreciate any help and thanks!