You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by victor gusz <vi...@yahoo.com> on 2003/07/30 22:32:04 UTC

reset() in my action form is not working

Hi,

I define a reset function and seset every form
variables to null, since I want to reset all inputs to
null after I hit submit button. I also put the
following
line before I return ActionForward in my action class:

request.setAttribute(mapping.getAttribute(),
sampleForm);

But its not working, after I hit submit button, old
values 
are still there. Am I missing something?

thanks,



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: reset() in my action form is not working

Posted by victor gusz <vi...@yahoo.com>.
Thanks, its working now.

--- Michael Ruppin <mr...@yahoo.com> wrote:
> That's not what the ActionForm.reset() method is
> for. 
> It's called prior to population of your ActionForm
> from the request, to set values for things which may
> not be in the request [but should be], like
> unchecked
> checkboxes.
> 
> What you need is some ActionForm.setEmpty() method
> to
> call before forwarding to whatever code renders your
> HTML.
> 
> m
> 
> --- victor gusz <vi...@yahoo.com> wrote:
> > Hi,
> > 
> > I define a reset function and seset every form
> > variables to null, since I want to reset all
> inputs
> > to
> > null after I hit submit button. I also put the
> > following
> > line before I return ActionForward in my action
> > class:
> > 
> > request.setAttribute(mapping.getAttribute(),
> > sampleForm);
> > 
> > But its not working, after I hit submit button,
> old
> > values 
> > are still there. Am I missing something?
> > 
> > thanks,
> > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site
> > design software
> > http://sitebuilder.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > struts-user-help@jakarta.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> http://sitebuilder.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: reset() in my action form is not working

Posted by Michael Ruppin <mr...@yahoo.com>.
That's not what the ActionForm.reset() method is for. 
It's called prior to population of your ActionForm
from the request, to set values for things which may
not be in the request [but should be], like unchecked
checkboxes.

What you need is some ActionForm.setEmpty() method to
call before forwarding to whatever code renders your
HTML.

m

--- victor gusz <vi...@yahoo.com> wrote:
> Hi,
> 
> I define a reset function and seset every form
> variables to null, since I want to reset all inputs
> to
> null after I hit submit button. I also put the
> following
> line before I return ActionForward in my action
> class:
> 
> request.setAttribute(mapping.getAttribute(),
> sampleForm);
> 
> But its not working, after I hit submit button, old
> values 
> are still there. Am I missing something?
> 
> thanks,
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> http://sitebuilder.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org