A form component represents a form to submit information filled by the user to the server.
Form tag is form
i.e.
<comp:form name="search_invoices">
Client id: <comp:inputbox name="client_id"/>
<comp:commandbutton type = "submit"
name = "search_button"
caption = "Search invoices"/>
</comp:form>
Once a form is submitted, the submit event is raised after validating the submitted information. For that purpose, we can add validators to our input components, which are raised before handling the submit event. See the __ValidationRuleComponent for more information about validating components
A form component redirect the user navigation to the same page by default, however we can define one of the both:
A target url and/or a list of parameters, to be loaded after handling the submit or
route and/or controller and/or action and/or a list of parameters, to build an url based on those values by ussing the lion url routing engine.
i.e.
<comp:form name = "search_invoices"
route = "search_invoice"
parameters = "search_mode=1" >
...
</comp:form>
In this example, we're going to redirect the navigation flow to the url built by the route "search_invoice". See the URLs and Routes to learn about url routing engine.
In the other hand, note that we can user parameters in both ways. Parameters is a comma-separated list of name/value pairs, which will be sent to the server as part of the submit. In case we are using a route, parameters will be embed within the url if the route defines placeholders for them.
The submit life-cycle is the following one:
Validate components on client side (if applicable)
Validate components on server side, as a redundant validation (if applicable)
Handle the submit event by calling the correspond event handler method (if applicable)
Redirect the execution to the front controller (continuing the normal execution)
Form components allow to specify a submit method, by setting the method attribute. Form components also allow a set of parameters to be set as hidden (for HTML clients), by setting the hiddenParameters attribute.