<FORM> : Form

Java class : leon.view.LyForm

ROLE

A form allows showing a set of fields.
This type of component is used to allow an application user to consult application data (non editable form) or else to input data (editable form). The default arrangement of the fields inside a form is based on a grid of two columns comprising as many lines as there are fields.
The first column contains the labels of the fields and the second one contains the input fields.

ATTRIBUTES

<!ATTLIST FORM
	  id NMTOKEN #REQUIRED
	  template NMTOKEN #IMPLIED
	  editable ( true | false) "true"
	  align ( LEFT | RIGHT | CENTER) "LEFT"
	  controller CDATA #IMPLIED
	  border ( true | false) "true"
	  font CDATA #IMPLIED
	  color CDATA #IMPLIED
	  fontColor CDATA #IMPLIED
	  warningColor CDATA #IMPLIED
	  errorColor CDATA #IMPLIED>
Attribute Mand. Description Default
id yes Identifier of the form.  
template no FORM.template  
editable no Indicates whether the form is editable or not.
However, the fields contained in an editable form can be non editable (editable attribute of a field).
true
align no Indicates the alignment of the fields contained in the form (left, right or center).
The default value is left.
LEFT
controller no Reference of the controller that manages the form (i.e. handles user demands and refresh content).  
border no Indicates if the form is outlined with a border. true
font no FORM.font  
color no FORM.color  
fontColor no FORM.fontColor  
warningColor no Color used to display a field on warning.  
errorColor no Color used to display a field on error.  

ELEMENTS

<!ELEMENT FORM 
	  (FIELD*,
	   CONSTRAINT?,
	   DATA*)>
Element Mand. Mult. Description
FIELD no yes List of the fields contained in the form.
CONSTRAINT no no Positioning constraint of the form.
DATA no yes FORM.DATA

SAMPLE

<!-- Form containing two input fields (name and age) -->
<FORM id="_form" editable="true">
	<FIELD id="_fieldName">
		<CAPTION label="BR_NAME"/>
		<TEXT label="Dupont"/>
	</FIELD>
	<FIELD id="_fieldAge">
		<CAPTION label="BR_AGE"/>
		<NUMBER label="29" type="INTEGER"/>
	</FIELD>
</FORM>