You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anthony Mutiso 2 <an...@utilitynet.net> on 2002/10/25 01:34:26 UTC

*reset* why is it not being called

I have a form that on succesful submission loops back to the same page but
more data is displayed at the bottom of the page. 

My problem is that the reset button in the form only clears the form to the
data that was in the form after the last submit. So every time I submit, if
I press reset nothing appears to work. If clear the form manually and press
reset, my old values from my last submit magically return. 

How to I correct this problem. config looks something like:

   <action path="/search"
           type="Test.SearchAction"
           name="searchForm"
           scope="request"
           validate="true"
           input="/search.jsp">
      <set-property property="loginRequired" value="false"/>
      <forward name="success" path="/search.jsp"/>
      <forward name="failure" path="/search.jsp"/>
   </action>

and I have a "   <forward name="search" path="/search.do"/>" in my global
forwards.
My form is "<html:form action="/search" focus="value" >".

and my reset function has clears my form, and has log messages that I only
see when the application start. Any pushing of the reset button does not
result in any new log entries.

What gives?

Thanks

Anthony

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


deprecated perform method in Action means roll your own Command Pattern

Posted by Tony Baity <to...@yahoo.com>.
Hello,
Just got back on the list again... man is it busy here....
hey... about the command pattern that appears to be disappearing from the Action class... do we roll our own now just using Action as a base class?
I really like that combined execute and perform functionality... so that I can weed out common (background) functionality between Action classes and keep the size of the individual Action subclasses down to a minimum... and also perhaps put common initialization in an init() method (which is in the execute method just above the execution of the perform)
So... judging from the deprecation that I now (guess its been there for a while but just haven't looked) find in the Action class there will be a day when the perform method is GONE! Also, the example Actions now (BTW when did this change) override the execute not the perform. Are command patterns then considered part of the business logic?
... if so, then I am confused since I have always considered the Action classes borderline business logic since they basically hold the steps of a transaction.
-Tony ( I think the really cool people now hang out in the Commons user group)
 



---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

Re: *reset* why is it not being called

Posted by David Derry <dd...@acm.org>.
If you mean <html:reset> , the docs states "Renders an HTML <input> element
of type reset." the behavior of the <input type="reset"> is to reset the
form values to their initial value. This is handled on the client end, so
the initial values would be what was first displayed when the page was
rendered. If you want to be able to restore the values to some stae prior to
that it is up to you to store that state somehow, and provide an action that
will restore that state. You would invoke that action by replacing the
'reset' button with a button that will submit to your reset action.

Dave Derry


----- Original Message -----
From: "Anthony Mutiso 2" <an...@utilitynet.net>


> I have a form that on succesful submission loops back to the same page but
> more data is displayed at the bottom of the page.
>
> My problem is that the reset button in the form only clears the form to
the
> data that was in the form after the last submit. So every time I submit,
if
> I press reset nothing appears to work. If clear the form manually and
press
> reset, my old values from my last submit magically return.
>
> How to I correct this problem. config looks something like:
>
>    <action path="/search"
>            type="Test.SearchAction"
>            name="searchForm"
>            scope="request"
>            validate="true"
>            input="/search.jsp">
>       <set-property property="loginRequired" value="false"/>
>       <forward name="success" path="/search.jsp"/>
>       <forward name="failure" path="/search.jsp"/>
>    </action>
>
> and I have a "   <forward name="search" path="/search.do"/>" in my global
> forwards.
> My form is "<html:form action="/search" focus="value" >".
>
> and my reset function has clears my form, and has log messages that I only
> see when the application start. Any pushing of the reset button does not
> result in any new log entries.
>
> What gives?
>
> Thanks
>
> Anthony
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>