Login  Register

Re: Xforms-select event

Posted by Erik Bruchez on Dec 11, 2010; 1:51am
URL: https://discuss.orbeon.com/Xforms-select-event-tp3080064p3082945.html

Martin,

Based on this example:

<xforms:select1 ref="some-ref">
  <xforms:label/>
  <xforms:item>
      <xforms:label>label1<xforms:label>
      <xforms:value>value1</xforms:value>
      <xforms:action ev:event="xforms-select">Some-action1<xforms:action>
  </xforms:item>
  <xforms:item>
      <xforms:label>label2<xforms:label>
      <xforms:value>value2</xforms:value>
      <xforms:action ev:event="xforms-select">Some-action2<xforms:action>
  </xforms:item>
</xforms:select1>

This is one of the cases that won't work because of the bug you pointed to [1].

Your event handlers here observe xforms:item elements, and this is not
yet supported.

So you need to observe xforms:select1 instead:

<xforms:select1 ref="some-ref">
  <xforms:action ev:event="xforms-select">…<xforms:action>

We have an extension event context information which you could use, e.g.:

<xforms:select1 ref="some-ref">
  <xforms:action ev:event="xforms-select"
if="event('xxforms:item-value') = ''value1">…<xforms:action>
  <xforms:action ev:event="xforms-select"
if="event('xxforms:item-value') = ''value2">…<xforms:action>

-Erik

[1] http://forge.ow2.org/tracker/?group_id=168&atid=350207&func=detail&aid=304019

On Thu, Dec 9, 2010 at 8:11 PM, Erik Bruchez <[hidden email]> wrote:

> Martin,
>
> You say you are trying to dispatch an event: do you mean that you are
> using xforms:dispatch for this? If so, what is the expected result?
>
> -Erik
>
> On Thu, Dec 9, 2010 at 4:41 AM,  <[hidden email]> wrote:
>> Hi,
>>
>> I'm trying to dispatch an xforms-select event in an xforms:select1 item, but it
>> doesn't seem to be working. I've found an 'ticket' about this subject and i'm
>> wondering if there is any work around, other than xforms-value-changed.
>>
>> The ticket can be found here:
>> http://forge.ow2.org/tracke/?group_id=168&atid=350207&func=detail&aid=304019
>>
>> Greetings,
>> Martin van der Lubbe
>>
>>
>> --
>> 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