I am trying to maintain which item was selected in a html:select
dropdown that is not "multiple" after the validation occurs in the Form
and I need to return to the jsp because something was missing.  Here is
my code snippet from my jsp:

 

      <logic:iterate id="workitem" name="manager" indexId="index"
property="workitems" type="com.my.app.WorkItem">

            <tr>

                  <td>                    

                        <html:select property="action" size="1"
indexed="true" >

                              <html:options name="workitem"
property="actions"/>

                        </html:select>

                  </td>

            </tr>

      </logic:iterate>

 

 

My Form reset method is empty:

 

    public void reset(ActionMapping mapping, HttpServletRequest request)
{

            //DO Nothing

    }

 

When the app returns to the jsp on validation error from the Form, the
selected item in the list is the first item (which is the default), and
not the one that was selected.  Why is the list being reset?  Why
doesn't it keep the selected item in the list when returning from the
Form?  How do I maintain the selected item in the list?

 

Thanks in advance for the help.

 

Regards,

Justin

 

 

Reply via email to