Platinum Partner

Webwork2 Multiple Buttons In Form

To react on multiple buttons in webforms use the following if you don't want to depend on the value attribute of the button (think of i18n):

And in the action: class FooAction implements Action { private Map buttonAction = new HashMap(); public Map getButtonAction() { return buttonAction; } public String execute() { if(buttonAction.containsKey("ok") { // ok was pressed } else if (buttonAction.containsKey("cancel") { // cancel was } else { // no button was pressed (enter key?) } ... } }
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}