xforms-value-changedAdded by IBM on October 10, 2012 | Version 1 (Original)
|Occurs when a value is changed in an XForms option.
Available In xforms:input option, xforms:output option, xforms:range option, xforms:secret option, xforms:select option, xforms:select1 option, xforms:textarea option
Example The following example assumes that you are working with a purchase order form that contains two data instances. The first data instance contains information about the products that can be purchases, as shown:
The second data instance contains the data elements that the user fills out to order the products:
<xforms:instance id="products" xmlns="">
<product name="Widget" code="W1" unitcost="9.99"/>
<product name="Gadget" code="G1" unitcost="5.49"/>
<product name="Trinket" code="T1" unitcost="11.25"/>
<product name="Gromet" code="G2" unitcost="7.77"/>
This instance is linked to a table item in the form, which creates a table with four columns: product name, unit cost, quantity, and line total. The product name is chosen from a popup item that contains the xforms:select1 shown below. When the user selects something from the popup, an xforms-value-changed event occurs. In this case, this event triggers two actions: first, the second column is automatically populated with the unit cost for that item (by getting that cost from the po instance); second, the focus is moved to the third column, since the second column has already been completed.
<xforms:instance id="po" xmlns="">
<xforms:select1 ref="product" appearance="minimal">
<xforms:setvalue ref="../unitCost" ev:event="xforms-value-changed"
- This event only occurs on xforms:select and xforms:select1 options that include an <xforms:itemset> element. If the option includes a list of <xforms:item> elements instead, use the xforms-select and xforms-deselect events.