Renders an Submit component with an onclick event handler that prevents the user from activating the link twice. The component acts together with other SubmitOnce,ImageSubmitOnce,DirectLinkOnce or LinkSubmitOnce components, which means that non of the mentioned components can be activated while another component request is processed.
Name | Type | Required | Default | Description |
---|---|---|---|---|
onclick | java.lang.String | no | An optional onclick eventhandler that is to be processed prior to any activation of the link, but after the components own check to se if any other request from a SubmitOnce,ImageSubmitOnce,DirectLinkOnce or LinkSubmitOnce component is being processed. | |
disabled | boolean | no | false | If set to true, the button will be disabled (will not respond to the mouse); the browser should provide a "greyed out" appearance. |
selected | Object | no | This parameter is bound to a property that is updated when the submit button is clicked by the user. The property is updated to match the tag parameter. | |
tag | Object | no | Tag used with the selected parameter to indicate which Submit button on a form was clicked. | |
listener | IActionListener | no |
An optional listener (typically specified as the name of a listener
method), notified when the Submit is triggered.
When invoking listeners invoked within a For loop this listener should be used. This parameter should not be used in the majority of cases as the listener is notified before all form data has been captured on the server. Only use this when you know you are going to redirect or do some other cancelling sort of action that isn't likely to alter form state. Use action as your preferred listener method parameter. |
|
action | IActionListener | no |
A listener that is notified if this component is triggered just before
the form's listener, after all components enclosed by the Form have had
a chance to update their properties.
If you are going to notify a listener, this is probably the parameter you want to bind to. |
|
parameters | Object | no |
Parameter(s) gathered at the time the button is triggered, supplied as
listener parameters in the IRequestCycle available to the listener.
If the parameter is a Collection, it will be converted to an Object array (to match the IRequestCycle getListenerParameters() signature). Allows listeners provided by the 'action' parameter to access any rewinded state not conveniently placed using tag/selected (e.g. when there are multiple objects to select as might happen with a nested For). |
|
submitType | String - [submit,cancel,refresh] | yes | submit |
Controls the type of submission that this component invokes. Using javascript
this parameter will cause the invocation of the component to be recognized as
a cancel/refresh/normal form submission depending on the value given. If you
have a cancel="listener" or refresh="listener"
parameter set on your Form they will be invoked
accordingly.
|
Insert a Submit that executes a userdefined onclick event, and prevents more than one click from the user: "..."
<a jwcid="@bayeux:SubmitOnce" href="#" onclick="return myOwnClientValidation()" listener="listener:myListener">my direct link<a>
<script type="javascript"> function myOwnClientValidation() { //some client validation to be done here return true; } </script>
public abstract class APage extends BasePage { public void myListener(IRequestCycle cycle) { System.out.println("my directlink is activated"); } }