Form tags

Nexaweb XAL now provides tags to support form-based submission from the client UI to the server. Your application's client can submit form-based information using HTTP Post or Get instructions.

To declare a form, use the <formRequest> tag. The following table describes in the  <formRequest> tag attributes: 

AttributeDescription

id

The id of this formRequest.


HTTP Method

Specifies the HTTP method to use for the form submission: GET or POST

GET - form data set gets appended to the URI specified by the action attribute (with a question-mark ("?") as separator) and this new URI passes to the processing agent. Use when the form causes no side-effects. For example, use the GET method for a database search.

POST - form data set is included in the body of the form and sent to the processing agent. Use when the form causes side-effects. For example, used POST method to modify a database or subscription to a service.

 
uri

Specifies the URI to which to sumbit the form.

For example:
uri="my.jsp"


target

Specifies the callback target.

For example:
target="mco.MyMco"


onSuccess

Specifies the onSuccess callback.

For example:
onSuccess="mco:myMco.onSuccess()"


onFailure

Specifies the onFailure callback.

For example:
onFailure="mco:myMco.onFailure()"


<headers> </headers>

Optional section to specify headers.

For example:
<headers>
 <header name="Content-Type">BLARGH</header>
</headers>

<parameters>
</parameters>

Specifies hidden fields whose values are not rendered but are submitted with the form. For example, to store information between client/server exchanges.

For example:
<parameters>
 <parameter name="parameter1">{0}</parameter>
 <parameter name="parameter2">{1}</parameter>
</parameters>

 To use a form in your application's UI, specify it as follows:

<textField name="customer_name" onCreate="form:myForm.addComponent(this)"/>

In addition, you can use form-base submission with validation syntax. For example:

<textField onCommand="mco:myMco.validate( mco:form ); mco:form1.submit()"/>