[ 
https://issues.apache.org/jira/browse/LABS-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12717320#action_12717320
 ] 

Simone Gianni commented on LABS-203:
------------------------------------

Raw notes :
- An event handler is a pojo
- It is added using form.addEventHandler(handler)
- On the pojo multiple methods may be present to handle initing and change of 
form values
- Method may be named :
... On<PropName>Change
... On<PropName>SubmitChange
... OnChange
... OnSubmitChange
... On<PropName>Init
... OnInit
- On*Init methods are called when form is inited (due to stateless nature, 
every time, but before values are bound)
- On*Change methods are called when property value change is detected
- *SubmitChange methods are called when the form has been submitted by the 
user, others also when auto-submit happens
- All these methods may have some parameters :
... the bean
... the FieldNode of the property
... the SmartForm itself
... the property value
- Any parameter may be missing, for example the following methods are all okay :
... onNameChange() (quite useless, but still correct)
... onNameChange(String value)
... onNameChange(Person bean)
... onNameChange(Person bean, String value)
... onNameChange(SmartForm form, String value)
... onChange(Person bean, String value) (will be called for every string value 
of a Person)
... onChange(Person bean, Node propertyNode, String value) (same as befor, but 
can use propertyNode to check which property we are dealing with)
- Same applies for "init"


> [docs] Document form events system
> ----------------------------------
>
>                 Key: LABS-203
>                 URL: https://issues.apache.org/jira/browse/LABS-203
>             Project: Labs
>          Issue Type: Task
>          Components: Magma
>    Affects Versions: Current
>            Reporter: Simone Gianni
>            Assignee: Simone Gianni
>             Fix For: Future
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to