struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin HaleBoyes <kzbo...@yahoo.com>
Subject html:submit question
Date Tue, 03 Dec 2002 15:30:50 GMT
I have a couple of <html:submit> elements on one <html:form>.
How do I distinguish between the different buttons?

Specifically, I have

 <html:submit property="operation">Edit Loan</html:submit>
 <html:submit property="operation">Reject Loan</html:submit>

The form bean has a setOpereration(String) setter method which
is called with the text of the button (ie, "Edit Loan")
when the form is submitted.

When I look at the HTML that is rendered in the browser, I see that
the property attribute becomes the "name" attribute of the <input>
element.

The way it works now, I have to compare the value of the operation
property of the form bean against the string that is displayed to
the user.  That seems a bit fragile - suppose the customer wants the
"Reject Loan" to be "Cancel Loan" instead.  I'd have to change code
in my action to effect the change.

I'm looking for an attribute to <html:submit> that is the value that
gets set to the property (operation).  Is there such a thing.

I want to avoid having a different form-bean-attribute for each
submit tag (like operation1, operation2, etc.).

Thanks,
Kevin.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
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