struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim T. Young" <Young_Ti...@cat.com>
Subject RE: how do i clear the form
Date Mon, 16 Sep 2002 21:03:52 GMT

Put a breakpoint in the getter method in your form and see who/when it is
being accessed.

Also, does it matter that the request still has the parameter in it from
the form submission?  Just a thought...

Tim






                                                                                         
                                                    
                    "Mark Silva"                                                         
                                                    
                    <msilva@authen                                                    
                                                       
                    ex.com>                                                           
                                                       
                                                                                         
                                                    
                    09/16/2002     To:      "Struts Users Mailing List" <struts-user@jakarta.apache.org>
                                     
                    03:56 PM       cc:                                                   
                                                    
                    Please respond                                                       
                                                    
                    to "Struts                                                           
                                                    
                    Users Mailing                                                        
                                                    
                    List"            Subject:    RE: how do i clear the form             
                                                    
                                                                                         
                                                    
                                                                                         
                                                    



Caterpillar: Confidential Green          Retain Until: 10/16/2002
                                         Retention Category:  G90 -
                                         Information and Reports




this is the strange thing.  even when i call form.reset(), the value is
still being populated.


-----Original Message-----
From: Nekkalapudi, Viplava [mailto:VNekkalapudi@erac.com]
Sent: Monday, September 16, 2002 1:44 PM
To: 'Struts Users Mailing List'
Subject: RE: how do i clear the form


When you submit the form, the flow of execution is:
   form.reset() --> form is populated with the URL entered (from request)
   --> form.validate() -- fails forwards to input page.
   --> then the AddUrlAction.
 At the end of action, you forward to the same page with the form value
populated.
 Try calling form.reset() at the end of your action class.

 -- Vip.

-----Original Message-----
From: Mark Silva [mailto:msilva@authenex.com]
Sent: Monday, September 16, 2002 3:29 PM
To: Struts Users Mailing List
Subject: RE: how do i clear the form


to clarify:

i have a simple for with a couple of text input values.  one of these
values
is a url.  (the user must type the url to add to the url list).  when i
submit this form, i forward to the current page again. (which shows the
added url in the list below the form).

the text input field for the url is being populated by the value that was
just typed and submitted.  it is required that the value be empty (reset
the
form to an initial state).

i will try the suggestion that was made to redirect the user instead, but
it
seems this should be possible for a forward.  especially when i am
explicitly setting the form value to its default state in the action class!


let me know if you need me to be more clear.

thanks,
mark


-----Original Message-----
From: Martin Cooper [mailto:martin.cooper@tumbleweed.com]
Sent: Monday, September 16, 2002 1:23 PM
To: 'Struts Users Mailing List'
Subject: RE: how do i clear the form


Can you clarify "the url value for the form is being populated by the url i
just added"? Do you mean the 'action' attribute of the HTML form is being
created with the value of the URL added by the previous request, instead of
with the path from your <action>, or do you mean something else?

--
Martin Cooper


> -----Original Message-----
> From: Mark Silva [mailto:msilva@authenex.com]
> Sent: Monday, September 16, 2002 12:19 PM
> To: Struts Users Mailing List
> Subject: how do i clear the form
>
>
> hello struts gurus,
>
> here is a seemingly straightforward question.
>
> i have a page that is a list of urls, and a form on top to
> add a url to this list.
> when i submit the form, i reload this page, and it displays
> the new list with the added url.
>
> my problem:  the url value for the form is being populated by
> the url i just added.  this must be because the request level
> form is repopulating the form.
>
> is there a way around this?  it doesn't seem like i should be
> reseting my forms in the action class, but is that the way to
> do things?
>
> my action config:
>
>     <action   path="/addUrl"
>               type="AddUrlAction"
>               name="urlForm"
>               scope="request">
>     </action>
>
> thanks,
> mark
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>
>


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


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

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


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






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


Mime
View raw message