|
|
![]() |
|
|||||
|
|||||||
|
|
|||||||
|
Proposal
for <event> in <action>
Send comments
to Cara Struble (mailto:cara@harmonia.com)
Abstract The name attribute of the event tag can be used to get further information on an event that occured. Currently, it can only be used in an <equal> tag like this (using the Java vocabulary for UIML in the example): <condition>
In the equal tag above, the condition is true only when an "itemStateChanged" event occurs on the combo box (i.e., some item is selected) AND the "item" piece of that event has the value "Dog". Events often have one or more pieces of data associated with them (referenced by the name attribute of <event>). In the above example, name="item" refers to the text string of the ComboBox item which was selected in the user interface. As another example, the pieces of data associated with a mouse event might be the X and Y coordinate of the mouse when the event was generated. What if we wanted to use the pieces of data associated with an <event> in the list of actions in the rule? In the above code example, we might want to set the value of some property to the value of the "item" from the event. This is not possible in the UIML specification of 17 January 2000. Proposal To allow data from events to be used in the action element of a rule, we would like to write something like this: <action>
The above code sets the text property of the label named Label to the string appearing in the combo box item which was selected in the user interface. Since information about an event can only be retrieved after the event has occured, the body of <property> could only contain an <event> if the <property> appears in an <action> element whose corresponding <condition> names the event. Following is an example: <rule>
Another use of <event> in <action> is to make <event> a child of <param>. This allows a method to be called and to give a piece of data from an event as an argument to the method. Following is an example: <rule>
If the event firing the rule was selection of an element named "Dog"in the combo box, then the code above will call a method named O.HandleTheSelection with one parameter, namely "Dog". Syntax changes
The semantics of <event> nested in <property> or <param> are the following:
This use of <event>
in <action> should not be confused with the case where <event> is
a direct child of <action>. The case of <event> as a direct child
of <action> retains the semantics in the UIML specification of 17
January 2000 that the named event must be fired.
© 1999-2001 UIML.org (all rights reserved) |