[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    Re: reset form in session scope
From:       atta-ur rehman <attaurrehman () gmail ! com>
Date:       2005-09-30 15:05:33
Message-ID: 2764e2d30509300805w9605691rd1cec2286508115e () mail ! gmail ! com
[Download RAW message or body]


The fundamental question is, can you afford a page submit for so callled
'reset' button? please change the 'reset' to 'submit' as shown below. Now
when user hits Reset, page is submitted with submit=reset; from this point
onwards you can clean stuff from session.

> <td>
> <div align="center">
> <html:submit value="search"/>
> </div>
> </td>
> <td>
> <div align="center">
<html:submit value="reset"> Reset </html:submit> <---------------------
> </div>
> </td>

ATTA

On 9/30/05, faisal.shoukat@bt.com <faisal.shoukat@bt.com> wrote:
>
> To do it the way you have shown then I would have to have a reset
> button/link next to the edit/delete link at the bottom of the page. Is
> that right?
>
> -----Original Message-----
> From: atta-ur rehman [mailto:attaurrehman@gmail.com]
> Sent: 30 September 2005 15:52
> To: Struts Users Mailing List
> Subject: Re: reset form in session scope
>
> Faisal,
>
> Are you saying you want to do it on client side? Using the 'normal' HTML
> reset? If so, I don't see how. That's why I assumed you're submitting
> for
> reset. The reset button only resets your form elements; and you can use
> javascript to call reset on more than one forms. But I don't see how can
> you
> get rid of results shown.
>
> Submitting for reset and claring sesion data would be easiest way. You
> can
> also use DHTML to remove results table from the current document if you
> absolutely want to do without a submit.
>
> I hope this helps.
>
> ATTA
>
> On 9/30/05, faisal.shoukat@bt.com <faisal.shoukat@bt.com> wrote:
> >
> > The reset button from the search form does not go to the
> > actionclientaction class. Maybe I have explained it badly.
> >
> > My jsp has some search fields and the user enters criteria into these
> > then clicks submit.
> >
> > This returns a table of results further down the page with checkboxes
> > associated with each line of result. And a edit or delete link at the
> > bottom. The user can select multiple checkboxes then edit or delete
> the
> > results.
> >
> > Next to the submit button below the search criteria is a reset button.
> > How would I blank the search criteria and get rid of the results
> > displayed below by clicking on reset.
> >
> > At the moment I have
> >
> > <td>
> > <div align="center">
> > <html:submit value="search"/>
> > </div>
> > </td>
> > <td>
> > <div align="center">
> > <html:reset value="reset"/>
> > </div>
> > </td>
> >
> > in my jsp and in my form I have a blank reset method. But this does
> not
> > get called.
> >
> >
> >
> > -----Original Message-----
> > From: atta-ur rehman [mailto:attaurrehman@gmail.com]
> > Sent: 30 September 2005 15:30
> > To: Struts Users Mailing List
> > Subject: Re: reset form in session scope
> >
> > in the actionClient action class, on reset button click:
> >
> > ActionForm form = (ActionForm)
> session.getAttribute("searchClientForm");
> > if (form != null) {
> > form.reset(...);
> > }
> >
> > only if I understood your question correctly and search form is not
> > doing
> > anything with mapping and/or request in it's reset() method!
> >
> > ATTA
> >
> > On 9/30/05, faisal.shoukat@bt.com <faisal.shoukat@bt.com> wrote:
> > >
> > > Hi,
> > >
> > > I have a search.jsp which contains two forms search form and a
> action
> > > form.
> > >
> > > The search form submits all the search criteria to the action class
> > > which queries the DB then returns a result. The action form then
> > > decides which action to do with what result.
> > >
> > > The problem I have is how do I reset the search form and the action
> > form
> > > with one button.
> > >
> > > I have two buttons on the search form, submit and reset. When I
> press
> > > reset I want to reset the search criteria and clear all the results
> > > which are being displayed.
> > >
> > > My struts config is as follows:
> > >
> > > <action path="/searchClient"
> > > type="com.medina.web.action.SearchClientAction"
> > > name="searchClientForm"
> > > scope="session"
> > > input="/searchClient.jsp"
> > > validate="true">
> > > <forward name="success" path="/searchClient.jsp"/>
> > > </action>
> > >
> > > <action path="/actionClient"
> > > type="com.medina.web.action.ActionClientAction"
> > > name="actionClientForm"
> > > scope="request"
> > > input="/searchClient.jsp"
> > > validate="true">
> > > <forward name="edit" path="/editClient.jsp"/>
> > > <forward name="delete" path="/deleteClient.jsp"/>
> > > <forward name="failure" path="/searchClient.jsp"/>
> > > </action>
> > >
> > > I have the search form in the seesion scope so when the results are
> > > validated they are still displayed and do not disappear.
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic