Action outside control doesn't work

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

Action outside control doesn't work

pumbosha
Hallo

I'm writing my own control and I have following problem. I want to trigger action on change one of instance. Is it possible? I tried do that in this way:

<xf:send ev:observer="instance_id" ev:event="xforms-value-changed" submission="my-submission"/>
 
but it doesn't not working. It working only in case, when I put <send> inside other control, for example:

<xf:input id="my_input" ref="instance('instance_id')">
    <xf:send ev:event="xforms-value-changed" submission="my-submission"/>
</xf:input>

Actually I would do that in this way, but I haven't access to #my_input, because it is localized outside my control. So, in simple way, I want to trigger send-submission on change input localized outside of my control xbl. How can I do that?

regards,
Tom
Reply | Threaded
Open this post in threaded view
|

Re: Action outside control doesn't work

Alessandro  Vernet
Administrator
Hi Tom,

There is no standard xforms-value-changed dispatched on instances, but Orbeon Forms adds an xxforms-value-changed for this. Is this something that would work in your case?

http://wiki.orbeon.com/forms/doc/developer-guide/xforms-events#TOC-xxforms-value-changed

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Action outside control doesn't work

pumbosha
Thank You. Is that means that this:

<xf:send ev:observer="instance('myInstance')" ev:event="xxforms-value-changed" submission="my-submission"/>

should work ?
Reply | Threaded
Open this post in threaded view
|

Re: Action outside control doesn't work

Erik Bruchez
Administrator
One problem is that in theory there can be many `xxforms-value-changed` events dispatched if many values change int the instance, and your submission will run many times.

Just something to be aware of and to watch.

-Erik