Help clearing a data form in struts
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Scott_Macri
Posted On:   Saturday, September 18, 2004 08:01 PM

Hi, I have create a struts app and the DTO's were created with DynaValidatorForm. Whenever I submit one of the forms, I then forward the page back to itself. For some reason the data in the forms won't clear when the page refreshes. It does this whether I set the redirect in the forward tag to true or false. I cannot use a reset method because the bean is created dynamically. Is there a way to do this with the dynamic form beans? Can someone please give me some insite to resolve this issue? Thanks!!! :)    More>>

Hi,
I have create a struts app and the DTO's were created with


DynaValidatorForm. Whenever I submit one of the forms, I then forward the


page back to itself. For some reason the data in the forms won't clear when


the page refreshes. It does this whether I set the redirect in the forward tag


to true or false. I cannot use a reset method because the bean is created


dynamically.


Is there a way to do this with the dynamic form beans?


Can someone please give me some insite to resolve this issue? Thanks!!!


:)

   <<Less

Re: Help clearing a data form in struts

Posted By:   Frank_Hu  
Posted On:   Sunday, September 19, 2004 05:59 PM

u can invoke reset method because the DynaValidatorForm inherit ActionForm.



for example:



public ActionForward update(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception

{




.....


DynaValidatorForm dynaForm = (DynaValidatorForm)form;

form.reset(mapping,request);


.....


}
About | Sitemap | Contact