<FIELD> : Field

Java class : leon.view.LyFormField

ROLE

A field is contained in a form and allows to show or to input application data.
It is principally made up of a label (optional) and an input field depending of the type of the data (text, number, date, color...).
It is possible to associate a tool bar and a help entry to this field

ATTRIBUTES

<!ATTLIST FIELD
	  id NMTOKEN #REQUIRED
	  template NMTOKEN #IMPLIED
	  editable ( true | false) "true"
	  optional ( true | false) "true"
	  enabled ( true | false) "true"
	  valid ( true | false) "true"
	  checkBox ( true | false) "false"
	  checked ( true | false) "false"
	  needCheck ( true | false) "false"
	  state ( NORMAL | ERROR | WARNING) "NORMAL"
	  message CDATA #IMPLIED
	  hidden ( true | false) "false"
	  controller CDATA #IMPLIED>
Attribute Mand. Description Default
id yes Identifier of the form.  
template no FIELD.template  
editable no If the form is editable, the value of this attribute indicates if the field is editable.
If the form in which this field is placed is not editable, the value of this attribute is ignored (the field is then not editable).
true
optional no Indicates whether the field is optional or not.
A non optional field (i.e. mandatory) must be input.
The only effect of this attribute at the level of the view is that the label will be displayed in bold.
true
enabled no Indicates whether the field is enabled or not (true if it is enabled).
If a field is editable but is not enabled, it is not possible to input any value.
true
valid no Indicates whether the field is valid or not.
A field declared as non-valid is a field for which the input value is wrong (examples: null value on a mandatory field, format that is not respected,...).
At the level of the view, the effect of this attribute is that the label will be displayed in red.
true
checkBox no Indicates that the field has an associated check box that allows enabling/disabling the corresponding input field. false
checked no Indicates whether the associated check box is checked or not. false
needCheck no Indicates if the modification of the value of this field implies the update of another field (true if an update should be performed). false
state no State of the field. The state of the field has one of the following values:
NORMAL: Normal state,
WARNING: warning state (non-blocking state)
ERROR: error state (blocking state).
NORMAL
message no Error or warning message displayed on input field.  
hidden no Indicates that the field is hidden (not displayed). false
controller no Reference of the controller that manages the field (i.e. handles user demands and refresh content).  

ELEMENTS

<!ELEMENT FIELD 
	  (CAPTION?,
	   (%FIELD_ITEM;)?,
	   TOOLBAR?,
	   CONSTRAINT?,
	   TIP?,
	   DATA*,
	   RELATION?,
	   UNIT?)>
Element Mand. Mult. Description
CAPTION no no Legend of the field.
FIELD_ITEM
no no Input field of the field.
TOOLBAR no no Tool bar associated to the field.
CONSTRAINT no no Positioning constraint of the field within its parent area.
TIP no no Tooltip associated to the field.
DATA no yes Application datas associated to the field.
RELATION no no Input field of Relation type.
UNIT no no Unit of the field.

SAMPLE

<!-- Input fields of text type (name) -->
<FIELD id="_fieldName">
	<CAPTION label="Nom"/>
	<TEXT label="Dupont"/>
	<TIP label="Enter the name of the user"/>
</FIELD>

<!-- Input fields of number type (age) -->
<FIELD id="_fieldAge">
	<CAPTION label="Age"/>
	<NUMBER label="29" pitch="1" decimals="0" vMin="0" vMax="120"/>
	<TIP label="The user's age"/>
</FIELD>