xforms-value-changed event

classic Classic list List threaded Threaded
8 messages Options
hcr
Reply | Threaded
Open this post in threaded view
|

xforms-value-changed event

hcr
 
 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:
 
...
<xforms:instance id="data">
     <a>
</xforms:instance>
...
<xforms:input ref="instance('data')/a">
     <xforms:action ev:event="xforms-value-changed">
         <!--to do some thing-->
     </xforms:action>
</xforms:input>
....
   
   but this way have a problem: The xforms-value-changed is dispatched when input control value changed, for example:
...
<xforms:instance id="data">
     <item>
           <a>1</a>
     </item>
     <item>
           <a>2</a>
     </item>
</xforms:instance>
...
<xforms:repeat nodeset="instance('data')/item" id='nav'>
 
<xforms:input ref="instance('data')/item[index('nav')]/a">
     <xforms:action ev:event="xforms-value-changed">
         <!--to do some thing-->
     </xforms:action>
</xforms:input>
 
   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
Reply | Threaded
Open this post in threaded view
|

Re: xforms-value-changed event

Erik Bruchez
Administrator
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:
>
> ...
> <xforms:instance id="data">
>      <a>
> </xforms:instance>
> ...
> <xforms:input ref="instance('data')/a">
>      <xforms:action ev:event="xforms-value-changed">
>          <!--to do some thing-->
>      </xforms:action>
> </xforms:input>
> ....
>
>    but this way have a problem: The xforms-value-changed is  
> dispatched when input control value changed, for example:
> ...
> <xforms:instance id="data">
>      <item>
>            <a>1</a>
>      </item>
>      <item>
>            <a>2</a>
>      </item>
> </xforms:instance>
> ...
> <xforms:repeat nodeset="instance('data')/item" id='nav'>
>
> <xforms:input ref="instance('data')/item[index('nav')]/a">
>      <xforms:action ev:event="xforms-value-changed">
>          <!--to do some thing-->
>      </xforms:action>
> </xforms:input>
>
>    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/



--
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
hcr
Reply | Threaded
Open this post in threaded view
|

Re: Re: xforms-value-changed event

hcr
 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折纯珍比萨,必胜宅急送网上点餐优惠多

--
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

main.xhtml (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: xforms-value-changed event

Erik Bruchez
Administrator
Hi,

The behavior is actually correct: the xforms-value-changed events are  
dispatched to the two fields whose values change when the index changes:

   <xforms:input ref="@name"/>
   <xforms:input ref="@value"/>

If you enable XForms logging, you will see the ids of the controls to  
which the events are dispatched.

-Erik

On Jul 24, 2008, at 6:03 PM, hechengrong wrote:

>  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折纯珍比萨,必胜宅急送网上点餐优惠多<main.xhtml>
> --
> 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/



--
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
hcr
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: xforms-value-changed event

hcr
 Thanks Erik.
    I just want a event(xforms-instance-node-value-changed) that is dispatched when the value of node of xforms:instance is changed. for example:
<xforms:instance>
    <a/>
</xforms:instance>
 
<xforms:input ref="/a">
 
   when value of "/a" node is changed, it will dispatch xforms-instance-node-value-changed. How can I implement in OPS?
 
 

在2008-07-26,"Erik Bruchez" <[hidden email]> 写道:
>Hi,
>
>The behavior is actually correct: the xforms-value-changed events are  
>dispatched to the two fields whose values change when the index changes:
>
>   
>   
>
>If you enable XForms logging, you will see the ids of the controls to  
>which the events are dispatched.
>
>-Erik
>
>On Jul 24, 2008, at 6:03 PM, hechengrong wrote:
>
>>  I try excute setindex, this will dispatch xforms-value-changed.  
>> example is in detail.
>>
>>
>>
>>
>> 在2008-07-25,"Erik Bruchez" 
>> --
>> 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/
>


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: xforms-value-changed event

Alessandro Vernet
Administrator
On Mon, Jul 28, 2008 at 3:05 AM, hechengrong <[hidden email]> wrote:

>     I just want a event(xforms-instance-node-value-changed) that is
> dispatched when the value of node of xforms:instance is changed. for
> example:
> <xforms:instance>
>     <a/>
> </xforms:instance>
>
> <xforms:input ref="/a">
>
>    when value of "/a" node is changed, it will dispatch
> xforms-instance-node-value-changed. How can I implement in OPS?
Since the xforms-value-changed tells you if the value bound to a
control has changed, to know if the value of a node changes, you just
need to have a control bound to that node and make sure that the
control stays bound to the same node.

BTW, I don't know if your actual code really looks like what you
quoted in the first message of this thread. You have a repeat, but
then only show the item for the current index. So your repeat is
always showing just one control. For sure, there would be simpler ways
to do this :).

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: xforms-value-changed event

Erik Bruchez
Administrator
In reply to this post by hcr
In XForms you can't listen directly to changes on instance data nodes.  
You have to listen to changes on controls bound to instance data nodes  
instead.

The easiest way to do this is to place an event handler for xforms-
value-changed on the control bound to your node /a.

-Erik

On Jul 28, 2008, at 3:05 AM, hechengrong wrote:

>  Thanks Erik.
>     I just want a event(xforms-instance-node-value-changed) that is  
> dispatched when the value of node of xforms:instance is changed. for  
> example:
> <xforms:instance>
>     <a/>
> </xforms:instance>
>
> <xforms:input ref="/a">
>
>    when value of "/a" node is changed, it will dispatch xforms-
> instance-node-value-changed. How can I implement in OPS?
>
>
>
> 在2008-07-26,"Erik Bruchez" <[hidden email]> 写道:
> >Hi,
> >
> >The behavior is actually correct: the xforms-value-changed events are
> >dispatched to the two fields whose values change when the index  
> changes:
> >
> >
> >
> >
> >If you enable XForms logging, you will see the ids of the controls to
> >which the events are dispatched.
> >
> >-Erik
> >
> >On Jul 24, 2008, at 6:03 PM, hechengrong wrote:
> >
> >>  I try excute setindex, this will dispatch xforms-value-changed.
> >> example is in detail.
> >>
> >>
> >>
> >>
> >> 在2008-07-25,"Erik Bruchez"
> >> --
> >> 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/
> >
>
> --
> 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/



--
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
hcr
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: xforms-value-changed event

hcr
 
   Yes, "The easiest way to do this is to place an event handler for xforms-
value-changed on the control bound to your node /a."
   The xforms-value-changed is dispatched when value of "/a" is changed. But some time xforms-value-changed also dispatch, for example:
   <xforms:repeat nodeset=".." id="repeat">
       <xforms:input ref="/a">
             <xforms:action ev:event="xforms-value-changed">
             </xforms:action>
       </xforms:input>
   </xforms:repeat>
when repeat index is changed, xforms-value-changed is dispatched.
 
 
 

在2008-07-30,"Erik Bruchez" <[hidden email]> 写道:
>In XForms you can't listen directly to changes on instance data nodes.  
>You have to listen to changes on controls bound to instance data nodes  
>instead.
>
>The easiest way to do this is to place an event handler for xforms- 
>value-changed on the control bound to your node /a.
>
>-Erik
>
>On Jul 28, 2008, at 3:05 AM, hechengrong wrote:
>
>>  Thanks Erik.
>>     I just want a event(xforms-instance-node-value-changed) that is  
>> dispatched when the value of node of xforms:instance is changed. for  
>> example:
>> 
>>     
>> 
>>
>> 
>>
>>    when value of "/a" node is changed, it will dispatch xforms- 
>> instance-node-value-changed. How can I implement in OPS?
>>
>>
>>
>> 在2008-07-26,"Erik Bruchez" 



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