Posted by
Stephanie Hall (TT) on
Nov 16, 2009; 3:22pm
URL: https://discuss.orbeon.com/xforms-action-not-always-firing-after-value-changed-tp621200p622173.html
That works like a charm! Thanks, Alex!
BTW, was that screencast supposed to have sound? Because it did not.
-----Original Message-----
From: Alessandro Vernet [mailto:
[hidden email]]
Sent: Sunday, November 15, 2009 3:59 AM
To:
[hidden email]
Subject: [ops-users] Re: <xforms:action> not always firing after value changed
Stephanie,
On Fri, Nov 13, 2009 at 1:38 PM, Stephanie Hall (TT) <
[hidden email]> wrote:
> So on one of my pages I have a repeater, and each row in this repeater
> has one radio button. The expected behavior is that each time I click
> a radio button, it should fire the xforms-value-changed event and run
> my Javascript function (we only want one of the radio buttons checked
> at any time across all the rows). The problem is as follows: Say I
> have 2 buttons. Clicking on the first one will fire the action event,
> then clicking on the second radio button will fire the action event,
> but going back and clicking the first button again will NOT trigger the event.
I assume that you want to have in the mainModel instance the true/false set depending on which radio button is selected, and that you want to have in tempMainInstance the index of the radio that was selected. Assuming that this is what you are looking for, I updated your example (see attached). The result is best illustrated with a
screencast:
http://screencast.com/t/M2M0ZDEw.
Without any JavaScript, the trick is to have the select1 store the position of the currently selected radio in the tempMainInstance, and to have the true/false values in mainModel driven by the index using a calculate. I hope that the code will be clearer than my attempt as explaining it! ;)
Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's Blog:
http://www.orbeon.com/blog/ My 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