struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randolph Watson <rpw...@earthlink.net>
Subject RE: Submit Actions
Date Wed, 03 Jul 2002 13:37:04 GMT
I have included a code snippet that provides an alternative solution:

<!-- other html, jsp code ... -->

    <htmltag:form method="POST"
                 name="productListForm"
                 type="com.dynegy.gui.ProductListBean"
                 scope="session"
                 action="RollingTermMaintenanceProdRefresh.do">
        <htmltag:submit property="action" styleClass="frm-button"
styleId="update" value="Update" />
        <htmltag:submit property="action" styleClass="frm-button"
styleId="refresh" value="Refresh" />
        <htmltag:hidden property="termCode" />
    </htmltag:form>

<!-- other html, jsp code ... -->

In the perform() method of the Action subclass, just evaluate the "action"
parameter. In the example above, the value will be either "Update" or
"Refresh".

I hope this answers your question.

Randolph


> -----Original Message-----
> From: Gruner, Manfred [mailto:Manfred.Gruner@gedas.de]
> Sent: Wednesday, July 03, 2002 8:05 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Submit Actions
>
>
> Hi ,
> You have to do this via Javascript!
> Put a hidden field in your form and set the value to the action
> that should be performed.
> The javascript will be called when you press a button. They are no
> longer of type submit. The javascript set the right value to the hidden
> field and then submits the form.
>
> Manfred
>
> > -----Original Message-----
> > From: Kamholz, Keith (corp-staff) USX [mailto:kkamholz@moog.com]
> > Sent: Wednesday, July 03, 2002 3:00 PM
> > To: Struts (E-mail)
> > Subject: Submit Actions
> >
> >
> > Hey everyone,
> > I have a question that may have a very simple answer.  I have
> > a small form
> > where the user enters an entry number.  There are two submit
> > buttons, one
> > for a 'Delete' and the other to 'Edit'.  I want to send a different
> > parameter to the action depending on which button is clicked.
> >  It would
> > indicate whether a 'Delete' or an 'Edit' was requested.
> > However, right now
> > my form tag just says <html:form
> > action="/TWCMC.do?action=delete">.  How can
> > I change this so that I can send the correct parameter that
> > corresponds to
> > the button pressed?  I'm sure someone knows how to this.
> > Thanks!
> >
> > ~ Keith
> > http://www.buffalo.edu/~kkamholz
> >
> >
> > --
> > 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