Hi,

or try this:
in the JSP (notice multi-lingual...)
  <tr>
    <td>
      <html:submit property="previous" disabled="true">
        <bean:message key="button.wizard.previous"/>
      </html:submit>
    </td>
    <td>
      <html:submit property="same">
        <bean:message key="button.wizard.same"/>
      </html:submit>
    </td>
    <td>
      <html:submit property="next">
        <bean:message key="button.wizard.next"/>
      </html:submit>
    </td>
  </tr>

in the action check which property has been filled with a non-null-value.
I factored that out in a base-Action-method called whichButton that 
receives an array of possible values:
  String[] possibleButtons = {"next", "same", "previous"};
  int submit = whichButton(request, possibleButtons);

The factored out method:
  protected int whichButton( HttpServletRequest request
                           , String[] buttonArray)
  {
    int result = -1;
    boolean found = false;

    if (request == null)
    {
      throw new java.lang.IllegalArgumentException("request must not be null");
    }

    if (buttonArray == null)
    {
      throw new java.lang.IllegalArgumentException("buttonArray must not be null");
    }

    String tempAttribute = null;

    for (int i = 0; i < buttonArray.length && !found; i++)
    {
      tempAttribute = request.getParameter(buttonArray[i]);
      if (tempAttribute != null && tempAttribute.length() > 0)
      {
        found = true;
        result = i;
      }
    }

    return result;
  }


hope this gives another chance...
Alexander


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 8:44 PM
To: [EMAIL PROTECTED]
Subject: RE: multiple html:submit buttons with different names?


Yes!

Thanks to everyone for your help today - if I can't work it out now there's
no hope! : )

I'm off for sleep now...

Rob Breeds




|--------+--------------------------------->
|        |          "Nocera, Robert"       |
|        |          <[EMAIL PROTECTED]|
|        |          fizer.com>             |
|        |                                 |
|        |          13/11/2001 19:39       |
|        |          Please respond to      |
|        |          "Struts Users Mailing  |
|        |          List"                  |
|        |                                 |
|--------+--------------------------------->
  
>---------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                           |
  |      To:     "'Struts Users Mailing List'" <[EMAIL PROTECTED]>        
                           |
  |      cc:                                                                           
                           |
  |      Subject:     RE: multiple html:submit buttons with different names?           
                           |
  |                                                                                    
                           |
  |                                                                                    
                           |
  
>---------------------------------------------------------------------------------------------------------------|





Or you could just do what ted said ;)



LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be
privileged. It is intended for the addressee(s) only. Access to this E-mail
by anyone else is unauthorized. If you are not an addressee, any disclosure
or copying of the contents of this E-mail or any action taken (or not
taken) in reliance on it is unauthorized and may be unlawful. If you are
not an addressee, please inform the sender immediately.

--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to