Corresponds to input type="submit" or input type="image", a client-side element that can force the enclosing form to submit. The submit responsible for the form submission will post a notification that allows the application to know that it was the responsible entity. The notification is named "selected" and has no context.
| Name | Type | Flags | Default | Default Prefix | Since | Description |
|---|---|---|---|---|---|---|
| context | Object | NOT Allow Null | prop | 5.1.0.0 | The list of values that will be made available to event handler method of this component when the form is submitted. | |
| defer | boolean | NOT Allow Null | prop | If true (the default), then any notification sent by the component will be deferred until the end of the form submission (this is usually desirable). | ||
| disabled | boolean | NOT Allow Null | false | prop | If true, then the field will render out with a disabled attribute (to turn off client-side behavior). Further, a disabled field ignores any value in the request when the form is submitted. | |
| event | String | NOT Allow Null | literal | The name of the event that will be triggered if this component is the cause of the form submission. The default is "selected". | ||
| image | Asset | NOT Allow Null | asset | 5.1.0.0 | If provided, the component renders an input tag with type "image". Otherwise "submit". |
Informal parameters: supported
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<body>
<h1>Edit User</h1>
<t:form>
<t:errors/>
<t:beaneditor t:id="user"/>
<p>
<input type="submit" value="Update User"/>
<t:submit t:id="delete" value="Delete User"/>
</p>
</t:form>
</html>
public class EditUser
{
@Inject
private UserDAO _userDAO;
@Persist
private User _user;
private boolean _deleteUser;
void onSelectedFromDelete() { _deleteUser = true; }
Object onSuccess()
{
if (_deleteUser)
_userDAO.delete(user.getId());
else
_userDAO.update(user);
return UserList.class;
}
public void setUser(User user) { _user = user; }
public User getUser() { return _user; }
}