Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revisionBoth sides next revision
en:wiki:2.-desarrollo-app:2.3.-codigo:c.-eventos:4.-onchange:start [2017/11/28 15:57] – [Nodo ONCHANGE] patriciaen:wiki:2.-desarrollo-app:2.3.-codigo:c.-eventos:4.-onchange:start [2017/11/28 15:57] – [Ejemplo de uso] patricia
Line 1: Line 1:
 +
 +{{indexmenu_n>1}}
 +===== ONCHANGE Node =====
 +\\
 +This node describes the fields whose changes you want to monitor and the actions that you want them to execute when the changes occur.
 +\\
 +When a change in value occurs in a property, the actions described are searched in the following way:
 +\\
 +<code xml>
 +<onchange>
 +
 + <field name="campo">
 +
 + <action atributos>
 + ...
 + </action> 
 +
 + </field> 
 +
 + <field name="campo"> 
 +
 + <action ....>
 + ...
 + </action> 
 +
 + </field> 
 +
 + ......
 +
 +</onchange> 
 +</code>
 +===== Example of use =====
 +\\
 +
 +<code xml>
 +<onchange>
 + <field name="MAP_HOMBRE">
 + <action name="runscript">
 + <script language="VBScript">
 + if this("MAP_HOMBRE") = "1" then
 + this("MAP_MUJER") = "0"
 + this("SEXO") = "H"
 + else
 + if this("MAP_MUJER") = "0" then
 + this("MAP_HOMBRE") = "1"
 + this("SEXO") = "H"
 + end if
 + end if
 + </script>
 + </action>
 + </field>
 + <field name="MAP_MUJER">
 + <action name="runscript">
 + <script language="VBScript">
 + if this("MAP_MUJER") = "1" then
 + this("MAP_HOMBRE") = "0"
 + this("SEXO") = "M"
 + else
 + if this("MAP_HOMBRE") = "0" then
 + this("MAP_MUJER") = "1"
 + end if
 + end if
 + </script>
 + </action>
 + </field>
 +</onchange>
 +</code>