Hi all,
I want to struggle with Struts with Weblogic 5.01...Does anyone have any
experience with Visual Age 3.5....

-----Original Message-----
From: Terence Jacyno [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 09, 2001 2:11 PM
To: [EMAIL PROTECTED]
Subject: Re: recognizing a button


Hi.

If you want to figure out which button was pressed directly within your
ActionForm, try this.

Within the ActionForm that you associated with your HTML form, place the
following:

          public void MyActionForm extends ActionForm {
              protected boolean m_loadPressed = false;
              protected boolean m_submitPressed = false;

              ...

              public void setLoad(String load) {
                  m_loadPressed = true;
              }
              public boolean isLoadPressed() {
                  return m_loadPressed;
              }

              public void setSubmit(String submit) {
                  m_submitPressed = true;
              }
              public boolean isSubmitPressed() {
                  return m_submitPressed;
              }

              ...

         }

Now you can access which button was pressed by consulting the
corresponding methods within the ActionForm passed to the Action.perform
method.

Don't forget to reset the boolean values when you redisplay the form!

Terence


William Jaynes wrote:

> String loadButton = (String)request.getParameter("load");
> String submitButton = (String)request.getParameter("submit");
>
> ----- Original Message -----
> From: "Bernhard J. Hirschmann" <[EMAIL PROTECTED]>
> To: "Struts-User" <[EMAIL PROTECTED]>
> Sent: Thursday, August 09, 2001 6:26 AM
> Subject: recognizing a button
>
> Hello!
>
> How can I recognize in the ActionServlet, which button was pressed?
> I have this two buttons:
>
> <html:submit value="Load" property="load"/>
> <html:submit value="Submit" property="submit"/>
>
> How can I get the value of the attribute "property" inside of the
> Action.perform method? I just can't figure out, which method to use.
>
> Thanks in advance,
> Bernhard


***************************************************************************

This e-mail and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you are not the intended recipient you are hereby notified that any
dissemination, forwarding, copying or use of any of the information is
prohibited.

The opinions expressed in this message belong to sender alone. There is no
implied endorsement by TURKCELL.

This e-mail has been scanned for all known computer viruses.

***************************************************************************

Reply via email to