wood burning stoves 2.0 *
The moose likes Struts and the fly likes Can button be mapped to member variable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Can button be mapped to member variable?" Watch "Can button be mapped to member variable?" New topic
Author

Can button be mapped to member variable?

Samuel Lugo
Greenhorn

Joined: Feb 28, 2005
Posts: 24
Hello,

Can a button be mapped to a member variable in the ActionForm? If it's clicked, true; if not, false?

Thanks,
lugos
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Can a button be mapped to a member variable in the ActionForm?

Yes, it can.
If it's clicked, true; if not, false?

No, that's not how it works. If you specify the following button:

<hml:submit property="saveButton" value="Save" />

If this button is pressed, when struts populates the Actionform bean, the saveButton property will be populated with whatever is in the value attribute, which in this case is "Save". If this button was not pressed, but some other button was pressed to perform the submit, the saveButton property will be null (or whatever its initial value is set to).
[ August 10, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can button be mapped to member variable?