Inserting a SubmitButton
To insert a submitButton component:
-
In the Design Structure Window of the desired file, locate the node in
which you wish to insert a submitButton component.
-
In the Component Palette, select Form Components
from the dropdown list, and then drag and drop the
submitButton component to the parent node of your choice.
The submitButton node is inserted and
highlighted under the expanded parent node.
-
In the Property Inspector, set the following attributes for the
submitButton component:
-
text - Enter the text that displays in the button.
-
action - reference to an action method sent by submitButton or the
static outcome of an action
-
actionListerner - method reference to an action listener
-
event - Enter the name of the event to trigger when this
button is pressed. The ID of this button is sent as the source
parameter. The
<submitButton>
element must be
inside the <form>
element being submitted.
-
name - Enter a name for the component.
-
formName - Enter the name of the form that should be
submitted. If this attribute is not set, UIX will search for the
first parent form that contains the button and use the name of
that parent form. This attribute is not supported on mobile
devices because the submitButton is limited to submitting the form
that contains it.
-
partialRenderMode - Default is none (i.e., full page
rendering is used to submit the form). To enable the button to use
partial page rendering to send events to the application, the id
attribute of submitButton must be set, the button component must
be contained in a
<body>
element, and the
<accessibility-mode>
element in the
UIX configuration file (uix-config.xml
) must be set to
inaccessible
. If any of the requirements are not met, or if
the browser is not capable of supporting partial page rendering,
full page rendering will be used instead. Specify a partial page
rendering behavior by selecting one of the following values:
-
self
- This enables partial page rendering using
only one target node, the Id of this submitButton component.
-
multiple
- This enables partial page rendering
using multiple partial target nodes. You must also set the
partialTargets attribute.
-
partialTargets - Enter the IDs of the partial target nodes
to re-render when the form is submitted. Do not list the ID of the
submitButton component because it is automatically included in the
partial targets list. The ID attribute of submitButton must be set.
-
primaryClientAction - Enter the client action to fire on
the client. In the right column, click the
icon to enter a ClientAction. See
Editing the PrimaryClientAction Attribute for details. Alternatively, use
the Advanced tab to enter an EL syntax
data binding expression or use the Bind to Data dialog to select a
data source for this complex attribute.
-
targetFrame - Enter the target frame for the button.
-
textAndAccessKey - To set both the button text and an
access key, use the ampersand ('&') notation. For example, setting
this attribute to "T&ext" will set the button label to "Text" and
the access key to 'e'.
-
unvalidated - Default is false (i.e., onSubmit validation
is fired before submission, and form submission only occurs if the
validation succeeds). Select true to disable onSubmit validation.
For example when the user presses the back button in a wizard, you
may want the form to be submitted, but do not want the values to
be validated. Not validating the input allows the values to be
remembered without forcing the user to correct any mistakes made
before moving back.
Note: To use data binding, see
Data Binding a Component Attribute.
To set an event handler for submitButton:
-
In the Property Inspector for submitButton, click
Set event handler to register an event handler.
-
Enter an event name in the dialog that displays, e.g., goto, null. etc.
-
To edit an event handler, click Go to event
handler in the Property Inspector.
You can enter an optional source of the event to be handled. If this
is set, this handler will only be fired if a "source" parameter on
the event matches this value. (All events fired by UIX components
include a "source" parameter matching the id or name of the
component.)
Example (UIX XML)
...
<form name="myform">
<contents>
<textInput text="Default input text" name="textfield"/>
<submitButton text="Enter"/>
</contents>
</form>
...
<!-- A button that submits the form without performing any validation. -->
...
<form name="myform">
<contents>
<textInput text="Default input text" name="textfield"/>
<submitButton text="Unvalidated Submit"
unvalidated="true" />
</contents>
</form>
...
<!-- A button that triggers an event when the form is submitted. -->
...
<form name="myform">
<contents>
<messageTextInput prompt="Search" name="search">
<end>
<submitButton text="Go" event="doSearch" />
</end>
</messageTextInput>
</contents>
</form>
...
<!-- if button is outside a form -->
...
<submitButton formName="form1"
text="Enter"/>
...
Related topics
About SubmitButton
About ResetButton
About UIX
Event Handlers
Inserting a ResetButton
Working with Form Components
Copyright © 1997, 2004, Oracle.
All rights reserved.