databound-select1 and Event

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

databound-select1 and Event

zapp88
Right now I'm porting oure application from orbeon 3 to orbeon 4. The problem is
databound-select1 (and other XBL elements don't allow event) processing.
In older version to enable such behavioir we had to uncomment the line responsible for sillencing all event's
In orbeon 4 there is no such line since event encapsulation on xbl is complete i guess.

My question is: is there any way to make databound-select1 to trigger events like "xforms-value-change" or similar.
Or is there any other way to make <action> when user select's item from dynamic list.
Reply | Threaded
Open this post in threaded view
|

Re: databound-select1 and Event

Alessandro  Vernet
Administrator
Since 2012-06-08, events are no longer automatically retargeted (see link below). In general you don't want events to be automatically retargeted: there can be all kind of events inside the component, and letting them escape the component:

- Breaks encapsulation, exposing some of the internals of the control.
- Is often a bug, e.g. xforms-value-changed for internal control, not for the value of the component itself.
- Can be a performance issue, creating lots of unnecessary events.

http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide#TOC-Event-propagation

You can explicitly dispatch the xforms-value-changed by adding the following inside the <xf:select1 ref="xxf:binding('fr-databound-select1')" id="select">:

<xf:dispatch name="xforms-value-changed" ev:event="xforms-value-changed" targetid="fr-databound-select1"/>

Now, I am wondering if the XBL engine couldn't handle this automatically for XBL components for which we have xxbl:mode="binding". So I won't check that change in for now, and a change to the XBL engine might be more generic. But in the meantime, the above change will do it.

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

Re: Re: databound-select1 and Event

Erik Bruchez
Administrator
Correct, in fact this is planned as the "value" mode for XBL components:

http://wiki.orbeon.com/forms/projects/xbl/toughts-about-xbl-next

I entered an issue:

https://github.com/orbeon/orbeon-forms/issues/437

-Erik

On Mon, Sep 10, 2012 at 6:21 PM, Alessandro  Vernet <[hidden email]> wrote:

> Since 2012-06-08, events are no longer automatically retargeted (see link
> below). In general you don't want events to be automatically retargeted:
> there can be all kind of events inside the component, and letting them
> escape the component:
>
> - Breaks encapsulation, exposing some of the internals of the control.
> - Is often a bug, e.g. xforms-value-changed for internal control, not for
> the value of the component itself.
> - Can be a performance issue, creating lots of unnecessary events.
>
> http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide#TOC-Event-propagation
>
> You can explicitly dispatch the xforms-value-changed by adding the following
> inside the <xf:select1 ref="xxf:binding('fr-databound-select1')"
> id="select">:
>
> <xf:dispatch name="xforms-value-changed" ev:event="xforms-value-changed"
> targetid="fr-databound-select1"/>
>
> Now, I am wondering if the XBL engine couldn't handle this automatically for
> XBL components for which we have xxbl:mode="binding". So I won't check that
> change in for now, and a change to the XBL engine might be more generic. But
> in the meantime, the above change will do it.
>
> Alex
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/databound-select1-and-Event-tp4655709p4655726.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.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
>


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