Posted by
Stephanie Hall (TT) on
Dec 07, 2009; 10:26pm
URL: https://discuss.orbeon.com/xforms-action-not-always-firing-after-value-changed-tp621200p954813.html
I should clarify that the radio buttons are not gone, rather my selected main does not display anymore.
-----Original Message-----
From: Stephanie Hall (TT) [mailto:
[hidden email]]
Sent: Monday, December 07, 2009 2:06 PM
To:
[hidden email]
Subject: [ops-users] RE: RE: Re: <xforms:action> not always firing after value changed
Resurrecting this thread because I have a question relating to it:
Now I am loading different sections of my instance based on which OS the user selects in a drop-down menu. My group ref changes depending on this using something like instance('main')/config[os=instance('selectedOS')/ostype].
So on default it loads windows 32, and I set the main for the win32 section (and I can see it in the log due to the debug output). Then if I switch it to the win64 section I can set that section's main. In both of these cases, the radio button shows up the way it should and the instance is populated as it should be. But if I want to switch back to displaying the win32 section, the radio buttons are gone. How can I get them to show up? It looks fine in the instance XML itself, but I am required to show it in the GUI also.
I've attached an example to help illustrate.
Thanks!
Stephanie
-----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