You can setup a property in your form bean to receive the value of the
button and just pack the button value with the product id (since if I
understand correctly you have a button for every product entry)

ie. <html:submit property="button" value="view produc list:productid"/>
and <html:submit property="button" value="do something else:productid"/>

in your action you can retrieve the property and compare it.

if (form.getButton().startsWith("view product list")) {
    String value = form.getButton();
    tokenize out the id with StringTokenizer or something.
       .. do the view product list stuff ...;
}
if (form.getButton().equals("do something else")) {
    same as above just do the something else
}

If I understand correctly the above is one solution although I might suggest
using a radio button(s) for product selection and then only one pair of
buttons.


----- Original Message -----
From: "Konstantina Stamopoulou" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 21, 2002 9:02 PM
Subject: html:submit button


Hello,
I have a problem and I can't fingure out the solution to it. Here is my
case:

I have a list of products (PoductBean) on my .jsp and each one of it have
two buttons (html:submit)  :

Button1 --> Display Information for this product
Button2 --> Use the information to do something else

My question is: How can I decide which product has been selected so as to
display its information on my next page?
>From what I have seen the html:submit tag does not contain any attributes to
pass request parameters.

Thank U in advance,
Konstantina








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

Reply via email to