I try excute setindex, this will dispatch xforms-value-changed. example is in detail.
在2008-07-25,"Erik Bruchez" <[hidden email]> 写道:
>Do you see this upon insert/delete? If so, that is a known issue. We
>dispatch too many xforms-value-changed.
>
>But this shouldn't happen just by changing the repeat index with
>setindex.
>
>-Erik
>
>On Jul 24, 2008, at 2:01 AM, hechengrong wrote:
>
>>
>> Hi,
>> I want to do some action when a node of xforms instance value
>> changed. How can I do it?
>> I can use xforms-value-changed to do it, for example:
>>
>> ...
>>
>>
>>
>> ...
>>
>>
>>
>>
>>
>> ....
>>
>> but this way have a problem: The xforms-value-changed is
>> dispatched when input control value changed, for example:
>> ...
>>
>> -
>> 1
>>
>> -
>> 2
>>
>>
>> ...
>>
>>
>>
>>
>>
>>
>>
>>
>> when repeat control index change from 1 to 2, will change input
>> control value, so dispatch xforms-value-changed of input control.
>> but node value of xforms instance control is not changed.
>>
>> Should dispatch event when xforms instance's node value changed?
>>
>>
>>
>>
>>
>>
>>
>>
>> 22元超值饭面,8.5折纯珍比萨,必胜宅急送网上点餐优惠多
>> --
>> You receive this message as a subscriber of the [hidden email]
>> mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>--
>Orbeon Forms - Web Forms for the Enterprise Done the Right Way
>http://www.orbeon.com/
>
22元超值饭面,8.5折纯珍比萨,必胜宅急送网上点餐优惠多<?xml version="1.0" encoding="UTF-8"?>
<xhtml:html xmlns:xhtml="
http://www.w3.org/1999/xhtml" xmlns:xforms="
http://www.w3.org/2002/xforms" xmlns:ev="
http://www.w3.org/2001/xml-events" xmlns:xxforms="
http://orbeon.org/oxf/xml/xforms" xmlns:xbl="
http://www.w3.org/ns/xbl" xmlns:f="
http://orbeon.org/oxf/xml/formatting" xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:widget="
http://orbeon.org/oxf/xml/widget" xmlns="
http://www.w3.org/1999/xhtml" xmlns:justep="
http://www.justep.com/x5#" xmlns:ajx="
http://www.ajaxforms.net/2006/ajx" xmlns:ns="
http://www.justep.com/x5#" xsl:version="2.0">
<xhtml:head>
<xforms:model>
<xforms:instance id="data">
<form xmlns="">
<items>
<item name="a" value="a"/>
<item name="b" value="b"/>
<item name="c" value="c"/>
<item name="d" value="d"/>
<item name="e" value="e"/>
</items>
<data/>
<index/>
</form>
</xforms:instance>
<xforms:instance id="template">
<form xmlns="">
<item name="new" value="new"/>
</form>
</xforms:instance>
</xforms:model>
</xhtml:head>
<xhtml:body>
<!--
<xforms:input ref="instance('data')/data">
<xforms:label/>
<xforms:action ev:event="DOMActivate">
<xxforms:script>alert('key down');</xxforms:script>
</xforms:action>
</xforms:input>
<xhtml:div onclick="alert('click')">asdfasfd</xhtml:div>
<xforms:input ref="instance('data')/data"/>
<xforms:input ref="instance('data')/index" incremental="true">
<xforms:label>test</xforms:label>
<xforms:action onclick="alert('ok')">
<xxforms:script>alert('key down');</xxforms:script>
</xforms:action>
</xforms:input>
<xforms:trigger>
<xforms:label>insert</xforms:label>
<xforms:action ev:event="DOMActivate">
<xforms:insert context="instance('data')/items" origin="instance('template')/item"/>
</xforms:action>
</xforms:trigger>
-->
<xforms:input ref="instance('data')/index">
</xforms:input>
<xforms:trigger>
<xforms:label>set index</xforms:label>
<xforms:action ev:event="DOMActivate">
<xforms:setindex repeat="repeat" index="instance('data')/index"/>
</xforms:action>
</xforms:trigger>
<xhtml:h1/>
<xhtml:table>
<xforms:repeat nodeset="instance('data')/items/item" id="repeat">
<!--
<xforms:action ev:event="xforms-repeat-index-changed">
<xxforms:script>alert('as');</xxforms:script>
<xforms:setvalue ref="instance('data')/data" value="instance('data')/items/item[index('repeat')]/@value"></xforms:setvalue>
<xforms:setvalue ref="instance('data')/index" value="index('repeat')"></xforms:setvalue>
</xforms:action>
-->
<xhtml:tr>
<xhtml:td><xforms:input ref="@name"/></xhtml:td>
<xhtml:td><xforms:input ref="@value"/></xhtml:td>
</xhtml:tr>
</xforms:repeat>
</xhtml:table>
<xhtml:h1>detail</xhtml:h1>
<xforms:group ref="instance('data')/items/item[index('repeat')]">
<xforms:action ev:event="xforms-value-changed">
<xxforms:script>alert('xforms value changed')</xxforms:script>
</xforms:action>
<xforms:input ref="@name"/>
<xforms:input ref="@value"/>
</xforms:group>
</xhtml:body>
</xhtml:html>
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: mailto:
[hidden email]
For general help: mailto:
[hidden email]?subject=help
OW2 mailing lists service home page:
http://www.ow2.org/wws