reset is currently not called if <html:form> creates the form bean, which
happens if you go to the JSP page directly without hitting ActionServlet
first.

I've submitted a patch to fix this, but it has not been committed yet.

    Erik


----- Original Message -----
From: "Renaud Waldura" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 10:12 AM
Subject: Re: multibox and reset()


> The signature for reset() is the following:
>
> void reset(ActionMapping, HttpServletRequest)
>
> I don't know whether setting the array reference is null is enough, or you
> truly need to create a zero-length array like in your example below.
>
> I set mine to null, it seemed to work.
>
>
>
>
> ----- Original Message -----
> From: "Dirk Jaeckel" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, September 14, 2001 6:26 AM
> Subject: multibox and reset()
>
>
> > Hi!
> >
> >
> > I am having trouble resetting a StringArray that is connected to a
> <html:multibox>-tag.
> >
> > HTML-Example:
> >
> > <html:form action="/map" method="GET">
> > <html:multibox value="parking" property="layer"/>
> > <html:multibox value="petrol" property="layer"/>
> >
> > <html:image property="layers" page="/img/update.gif"/>
> >
> > </html:form>
> >
> >
> > Corresponding ActionForm:
> >
> > public class MapForm extends ActionForm {
> >
> >         private String[] _on = new String[0];
> >
> >         public void reset() {
> > _on = new String[0];
> >         }
> >
> >         public void setLayer(String in) {
> > _on = in;
> >         }
> >
> >         public String[] getLayer() {
> > return _on;
> >
> >         }
> > }
> >
> > The Manual told me to use the reset()-method to set The Array to the
> length 0, but reset() is never called.
> >
> >
> > Dirk
> >
> >
>
>

Reply via email to