Difference between revisions of "Scout/Concepts/Field"
m (→Value fields) |
(→Contribution to the Form lifecycle) |
||
(27 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
* extends: {{ScoutJavadoc|AbstractFormField|C}} | * extends: {{ScoutJavadoc|AbstractFormField|C}} | ||
− | == | + | == Type of fields == |
− | + | ||
It is possible to distinguish different types of fields: | It is possible to distinguish different types of fields: | ||
Line 20: | Line 19: | ||
! Swing Rayo | ! Swing Rayo | ||
|- | |- | ||
− | | {{ScoutLink|Concepts | + | | {{ScoutLink|Concepts|StringField}} || [[Image:Scout_3.8_StringField_RAP.png]] || [[Image:Scout_3.8_StringField_SWT.png]] || [[Image:Scout_3.8_StringField_Swing.png]] || [[Image:Scout_3.8_StringField_Swing_Rayo.png]] |
|- | |- | ||
− | | {{ScoutLink|Concepts| | + | | {{ScoutLink|Concepts|LabelField}} || [[Image:Scout_3.8_LabelField_RAP.png]] || [[Image:Scout_3.8_LabelField_SWT.png]] || [[Image:Scout_3.8_LabelField_Swing.png]] || [[Image:Scout_3.8_LabelField_Swing_Rayo.png]] |
|- | |- | ||
− | | {{ScoutLink|Concepts| | + | | {{ScoutLink|Concepts|IntegerField}} || [[Image:Scout_3.8_IntegerField_RAP.png]] || [[Image:Scout_3.8_IntegerField_SWT.png]] || [[Image:Scout_3.8_IntegerField_Swing.png]] || [[Image:Scout_3.8_IntegerField_Swing_Rayo.png]] |
|- | |- | ||
− | | {{ScoutLink|Concepts| | + | | {{ScoutLink|Concepts|LongField}} || [[Image:Scout_3.8_LongField_RAP.png]] || [[Image:Scout_3.8_LongField_SWT.png]] || [[Image:Scout_3.8_LongField_Swing.png]] || [[Image:Scout_3.8_LongField_Swing_Rayo.png]] |
|- | |- | ||
− | | {{ScoutLink|Concepts| | + | | {{ScoutLink|Concepts|BigIntegerField}} || [[Image:Scout_3.8_BigIntegerField_RAP.png]] || [[Image:Scout_3.8_BigIntegerField_SWT.png]] || [[Image:Scout_3.8_BigIntegerField_Swing.png]] || [[Image:Scout_3.8_BigIntegerField_Swing_Rayo.png]] |
|- | |- | ||
− | | colspan=" | + | | {{ScoutLink|Concepts|DoubleField}} || [[Image:Scout_3.8_DoubleField_RAP.png]] || [[Image:Scout_3.8_DoubleField_SWT.png]] || [[Image:Scout_3.8_DoubleField_Swing.png]] || [[Image:Scout_3.8_DoubleField_Swing_Rayo.png]] |
+ | |- | ||
+ | | {{ScoutLink|Concepts|BigDecimalField}} || [[Image:Scout_3.8_BigDecimalField_RAP.png]] || [[Image:Scout_3.8_BigDecimalField_SWT.png]] || [[Image:Scout_3.8_BigDecimalField_Swing.png]] || [[Image:Scout_3.8_BigDecimalField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|FileChooserField}} || [[Image:Scout_3.8_FileChooserField_RAP.png]] || [[Image:Scout_3.8_FileChooserField_SWT.png]] || [[Image:Scout_3.8_FileChooserField_Swing.png]] || [[Image:Scout_3.8_FileChooserField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|BooleanField|BooleanField or CheckBox}} || [[Image:Scout_3.8_BooleanField_RAP.png]] || [[Image:Scout_3.8_BooleanField_SWT.png]] || [[Image:Scout_3.8_BooleanField_Swing.png]] || [[Image:Scout_3.8_BooleanField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|SmartField}} || [[Image:Scout_3.8_SmartField_RAP.png]] || [[Image:Scout_3.8_SmartField_SWT.png]] || [[Image:Scout_3.8_SmartField_Swing.png]] || [[Image:Scout_3.8_SmartField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|ProposalField}} || [[Image:Scout_4.0_ProposalField_RAP.png]] || [[Image:Scout_4.0_ProposalField_SWT.png]] || [[Image:Scout_4.0_ProposalField_Swing.png]] || [[Image:Scout_4.0_ProposalField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|DateField}} || [[Image:Scout_3.8_DateField_RAP.png]] || [[Image:Scout_3.8_DateField_SWT.png]] || [[Image:Scout_3.8_DateField_Swing.png]] || [[Image:Scout_3.8_DateField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|TimeField}} || [[Image:Scout_3.8_TimeField_RAP.png]] || [[Image:Scout_3.8_TimeField_SWT.png]] || [[Image:Scout_3.8_TimeField_Swing.png]] || [[Image:Scout_3.8_TimeField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|DateTimeField}} || [[Image:Scout_3.8_DateTimeField_RAP.png]] || [[Image:Scout_3.8_DateTimeField_SWT.png]] || [[Image:Scout_3.8_DateTimeField_Swing.png]] || [[Image:Scout_3.8_DateTimeField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|CalendarField}} || [[Image:Scout_3.8_CalendarField_RAP.png]] || [[Image:Scout_3.8_CalendarField_SWT.png]] || [[Image:Scout_3.8_CalendarField_Swing.png]] || [[Image:Scout_3.8_CalendarField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|ListBox}} || [[Image:Scout_3.8_ListBox_RAP.png]] || [[Image:Scout_3.8_ListBox_SWT.png]] || [[Image:Scout_3.8_ListBox_Swing.png]] || [[Image:Scout_3.8_ListBox_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|TreeBox}} || [[Image:Scout_3.8_TreeBox_RAP.png]] || [[Image:Scout_3.8_TreeBox_SWT.png]] || [[Image:Scout_3.8_TreeBox_Swing.png]] || [[Image:Scout_3.8_TreeBox_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|MailField}} || only Swing available || only Swing available || [[Image:Scout_3.8_MailField_Swing.png]] || [[Image:Scout_3.8_MailField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|HtmlField}} || [[Image:Scout_3.8_HtmlField_RAP.png]] || [[Image:Scout_3.8_HtmlField_SWT.png]] || [[Image:Scout_3.8_HtmlField_Swing.png]] || [[Image:Scout_3.8_HtmlField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|BrowserField}} || [[Image:Scout_3.8_BrowserField_RAP.png]] || [[Image:Scout_3.8_BrowserField_SWT.png]] || [[Image:Scout_3.8_BrowserField_Swing.png]] || [[Image:Scout_3.8_BrowserField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|DocumentField}} || colspan="4" align="center" | This will be released soon as a scout swing fragment under epl. | ||
+ | |- | ||
+ | | colspan="5" align="center" | See also the main article on {{ScoutLink|Concepts|ValueField|value fields}} | ||
|- | |- | ||
|} | |} | ||
Line 39: | Line 70: | ||
|-{{BMTHStyle}} | |-{{BMTHStyle}} | ||
! Field | ! Field | ||
− | ! | + | ! RAP |
+ | ! SWT | ||
+ | ! Swing | ||
+ | ! Swing Rayo | ||
|- | |- | ||
− | | {{ScoutLink|Concepts|GroupBox|GroupBox | + | | {{ScoutLink|Concepts|GroupBox|GroupBox}} || [[Image:Scout_3.8_GroupBox_RAP.png]] || [[Image:Scout_3.8_GroupBox_SWT.png]] || [[Image:Scout_3.8_GroupBox_Swing.png]] || [[Image:Scout_3.8_GroupBox_Swing_Rayo.png]] |
|- | |- | ||
− | | {{ScoutLink|Concepts|TabBox|TabBox | + | | {{ScoutLink|Concepts|TabBox|TabBox}} || [[Image:Scout_3.8_TabBox_RAP.png]] || [[Image:Scout_3.8_TabBox_SWT.png]] || [[Image:Scout_3.8_TabBox_Swing.png]] || [[Image:Scout_3.8_TabBox_Swing_Rayo.png]] |
|- | |- | ||
− | | {{ScoutLink|Concepts|SequenceBox|SequenceBox | + | | {{ScoutLink|Concepts|SequenceBox|SequenceBox}} || [[Image:Scout_3.8_SequenceBox_RAP.png]] || [[Image:Scout_3.8_SequenceBox_SWT.png]] || [[Image:Scout_3.8_SequenceBox_Swing.png]] || [[Image:Scout_3.8_SequenceBox_Swing_Rayo.png]] |
|- | |- | ||
− | | ... || ... | + | | {{ScoutLink|Concepts|SplitBox|SplitBox}} || [[Image:Scout_3.8_SplitBox_RAP.png]] || [[Image:Scout_3.8_SplitBox_SWT.png]] || [[Image:Scout_3.8_SplitBox_Swing.png]] || [[Image:Scout_3.8_SplitBox_Swing_Rayo.png]] |
|- | |- | ||
− | | colspan=" | + | | {{ScoutLink|Concepts|RadioButtonGroup|RadioButtonGroup}} || [[Image:Scout_3.8_RadioButtonGroup_RAP.png]] || [[Image:Scout_3.8_RadioButtonGroup_SWT.png]] || [[Image:Scout_3.8_RadioButtonGroup_Swing.png]] || [[Image:Scout_3.8_RadioButtonGroup_Swing_Rayo.png]] |
+ | |- | ||
+ | | colspan="5" align="center" | See also the main article on {{ScoutLink|Concepts|CompositeField|composite field}} | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | ===Buttons=== | ||
+ | {|{{BMTableStyle}} | ||
+ | |-{{BMTHStyle}} | ||
+ | ! Button | ||
+ | ! RAP | ||
+ | ! SWT | ||
+ | ! Swing | ||
+ | ! Swing Rayo | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|Button|Button}} || [[Image:Scout_3.8_Button_RAP.png]] || [[Image:Scout_3.8_Button_SWT.png]] || [[Image:Scout_3.8_Button_Swing.png]] || [[Image:Scout_3.8_Button_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|ToggleButton|ToggleButton}} || [[Image:Scout_3.8_ToggleButton_RAP.png]] || [[Image:Scout_3.8_ToggleButton_SWT.png]] || [[Image:Scout_3.8_ToggleButton_Swing.png]] || [[Image:Scout_3.8_ToggleButton_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|LinkButton|LinkButton}} || [[Image:Scout_3.8_LinkButton_RAP.png]] || [[Image:Scout_3.8_LinkButton_SWT.png]] || [[Image:Scout_3.8_LinkButton_Swing.png]] || [[Image:Scout_3.8_LinkButton_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|RadioButton|RadioButton}} || [[Image:Scout_3.8_RadioButton_RAP.png]] || [[Image:Scout_3.8_RadioButton_SWT.png]] || [[Image:Scout_3.8_RadioButton_Swing.png]] || [[Image:Scout_3.8_RadioButton_Swing_Rayo.png]] | ||
|- | |- | ||
|} | |} | ||
===Other fields=== | ===Other fields=== | ||
− | + | {|{{BMTableStyle}} | |
+ | |-{{BMTHStyle}} | ||
+ | ! Field | ||
+ | ! RAP | ||
+ | ! SWT | ||
+ | ! Swing | ||
+ | ! Swing Rayo | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|TableField|TableField}} || [[Image:Scout_3.8_TableField_RAP.png]] || [[Image:Scout_3.8_TableField_SWT.png]] || [[Image:Scout_3.8_TableField_Swing.png]] || [[Image:Scout_3.8_TableField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|TableField|TreeField}} || colspan="4" align="center" | {{Note|TODO|Add screenshots for the TreeField}} | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|PageField|PageField}} || [[Image:Scout_3.8_PageField_RAP.png]] || [[Image:Scout_3.8_PageField_SWT.png]] || [[Image:Scout_3.8_PageField_Swing.png]] || [[Image:Scout_3.8_PageField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|ImageField|ImageField}} || [[Image:Scout_3.8_ImageField_RAP.png]] || [[Image:Scout_3.8_ImageField_SWT.png]] || [[Image:Scout_3.8_ImageField_Swing.png]] || [[Image:Scout_3.8_ImageField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|SVGField|SVGField}} || [[Image:Scout_3.8_SVGField_RAP.png]] || [[Image:Scout_3.8_SVGField_SWT.png]] || [[Image:Scout_3.8_SVGField_Swing.png]] || [[Image:Scout_3.8_SVGField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|PlannerField|PlannerField}} || only Swing available || only Swing available || [[Image:Scout_3.8_PlannerField_Swing.png]] || [[Image:Scout_3.8_PlannerField_Swing_Rayo.png]] | ||
+ | |- | ||
+ | | {{ScoutLink|Concepts|WrappedFormField|WrappedFormField}} || colspan="4" align="center" | Contains another form | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | |||
+ | == Contribution to unsaved changes == | ||
+ | Each field controls if he contains modifications or not. This information is used by the form for its {{ScoutLink|Concepts|Form#Form_lifecycle|lifecycle management}} in particular to decide if a save action is required or not. | ||
+ | |||
+ | Each field defines if it contains unsaved modifications with the method <tt>isSaveNeeded()</tt>. The property is updated when <tt>checkSaveNeeded()</tt> is called on the field. The implementation of this method checks: | ||
+ | * the value of the <tt>m_touched</tt> flag. | ||
+ | * the value returned by <tt>execIsSaveNeeded()</tt> ({{ScoutEvent|IsSaveNeeded}} event). | ||
+ | |||
+ | The <tt>m_touched</tt> flag can be modified with <tt>touch()</tt> (flag is set to true) and <tt>markSaved()</tt> (flag is set to false). Additionally when the flag is set to false the event {{ScoutEvent|MarkSaved}} is triggered. Depending on the type of field this event will: reset the initial value to the current value for value fields or propagate the call to all the children for a composite field. | ||
− | + | The <tt>execIsSaveNeeded()</tt> method provides a way to add field-specific logic to tell if the field contains informations that require a save action (at form level) or not. The default implementation just compares the initial value with the current value. If they are not equals the method return true (to indicate that a save action is needed to save the content of this field). | |
== Properties == | == Properties == |
Latest revision as of 13:27, 25 September 2014
Scout |
Wiki Home |
Website |
Download • Git |
Community |
Forums • Blog • Twitter • G+ |
Bugzilla |
Bugzilla |
Field are elements in Form
Contents
Type of fields
It is possible to distinguish different types of fields:
Value fields
These fiels contain a value. There are specific implementation depending on the type of data:
Field | RAP | SWT | Swing | Swing Rayo |
---|---|---|---|---|
StringField | ![]() |
![]() |
![]() |
![]() |
LabelField | ![]() |
![]() |
![]() |
![]() |
IntegerField | ![]() |
![]() |
![]() |
![]() |
LongField | ![]() |
![]() |
![]() |
![]() |
BigIntegerField | ![]() |
![]() |
![]() |
![]() |
DoubleField | ![]() |
![]() |
![]() |
![]() |
BigDecimalField | ![]() |
![]() |
![]() |
![]() |
FileChooserField | ![]() |
![]() |
![]() |
![]() |
BooleanField or CheckBox | ![]() |
![]() |
![]() |
![]() |
SmartField | ![]() |
![]() |
![]() |
![]() |
ProposalField | File:Scout 4.0 ProposalField RAP.png | ![]() |
File:Scout 4.0 ProposalField Swing.png | File:Scout 4.0 ProposalField Swing Rayo.png |
DateField | ![]() |
![]() |
![]() |
![]() |
TimeField | ![]() |
![]() |
![]() |
![]() |
DateTimeField | ![]() |
![]() |
![]() |
![]() |
CalendarField | ![]() |
![]() |
![]() |
![]() |
ListBox | ![]() |
![]() |
![]() |
![]() |
TreeBox | ![]() |
![]() |
![]() |
![]() |
MailField | only Swing available | only Swing available | ![]() |
![]() |
HtmlField | ![]() |
![]() |
![]() |
![]() |
BrowserField | ![]() |
![]() |
![]() |
![]() |
DocumentField | This will be released soon as a scout swing fragment under epl. | |||
See also the main article on value fields |
Composite fields
To group other fields
Field | RAP | SWT | Swing | Swing Rayo |
---|---|---|---|---|
GroupBox | ![]() |
![]() |
![]() |
![]() |
TabBox | ![]() |
![]() |
![]() |
![]() |
SequenceBox | ![]() |
![]() |
![]() |
![]() |
SplitBox | ![]() |
![]() |
![]() |
![]() |
RadioButtonGroup | ![]() |
![]() |
![]() |
![]() |
See also the main article on composite field |
Buttons
Button | RAP | SWT | Swing | Swing Rayo |
---|---|---|---|---|
Button | ![]() |
![]() |
![]() |
![]() |
ToggleButton | ![]() |
![]() |
![]() |
![]() |
LinkButton | ![]() |
![]() |
![]() |
![]() |
RadioButton | ![]() |
![]() |
![]() |
![]() |
Other fields
Field | RAP | SWT | Swing | Swing Rayo |
---|---|---|---|---|
TableField | ![]() |
![]() |
![]() |
![]() |
TreeField | ||||
PageField | ![]() |
![]() |
![]() |
![]() |
ImageField | ![]() |
![]() |
![]() |
![]() |
SVGField | ![]() |
![]() |
![]() |
![]() |
PlannerField | only Swing available | only Swing available | ![]() |
![]() |
WrappedFormField | Contains another form |
Contribution to unsaved changes
Each field controls if he contains modifications or not. This information is used by the form for its lifecycle management in particular to decide if a save action is required or not.
Each field defines if it contains unsaved modifications with the method isSaveNeeded(). The property is updated when checkSaveNeeded() is called on the field. The implementation of this method checks:
- the value of the m_touched flag.
- the value returned by execIsSaveNeeded() (IsSaveNeeded event).
The m_touched flag can be modified with touch() (flag is set to true) and markSaved() (flag is set to false). Additionally when the flag is set to false the event MarkSaved is triggered. Depending on the type of field this event will: reset the initial value to the current value for value fields or propagate the call to all the children for a composite field.
The execIsSaveNeeded() method provides a way to add field-specific logic to tell if the field contains informations that require a save action (at form level) or not. The default implementation just compares the initial value with the current value. If they are not equals the method return true (to indicate that a save action is needed to save the content of this field).
Properties
Defined with getConfiguredXxxxxx() methods.
Events
Defined with execXxxxxx() methods.