Form Radio buttons not updating on screen when setting their values using actions

I'm making a software simulation and I need to get a selection made in one button radio button group to immediately change the option selected in a different radio button group in the same form. I am currently using an action that modifes variable to to set the value of the reserved variable for radio button group 2. The values of the each of the options in group 2 are strings, not numbers.


I don't want to fake having radio button group 2's option selected changing by simply swapping out the radio buttons for a second set using show/hide of two sets with a different default value for each. That creates problems when I want to evaluate if the user has all the right options selected when they click an OK button (the buton set shown on the screen at that moment might not be the one I'm checking the value of). Note the OK button is not an actual form submit button. Just a trigger for a chain of other actions.



Radio Button group 1 Radio Button Group 2

A foo

B bar

C

D


Selecting an option in Radio button group 1 triggers an action group who's only relevant action is...


Modify Variable

Target: the reserved variable name for radio button group 2

Value: foo

Condition ANY: reserved variable name for radio button group 1 Contains B

Condition ANY: reserved variable name for radio button group 1 Contains C

Condition ANY: reserved variable name for radio button group 1 Contains D

Else: Modify Variable

target: reserved variable name for radio button group 2

value: bar


What i see when I run in debug is that the reserved variable name for radio button group 2 gets set to bar but the screen never updates to refelct that. Same things happens when running or previewing in browser.


It might be relevant that the simulation starts with a transparent button with no action covering the bar option button in radio group 2 since that option isn't permitted to the user until they select B, C, or D from radio group 1.


For this reason I have a action in the same action group as the action above that does this

Show

Target: transparent button

Condition: reserved variable name for radio button group 1 Equal To A

Else: Hide

target: reserved variable name for radio button group 2

value: transparent button


Can anyone tell me how to Group 2 to show "bar" as the option selected when options b, c, or d are selected in group 1?


--Shayne Weyker


p.s. I ran Lectora 11 today and don't see anything in different in the options for actions which presents an obvious fix, nor does the file it makes that makes the above work as desired. Much nicer looking interface though.

Discussion (3)

Thanks for your reply.


I tried adding a change contents action to my action group that sets the value of radio group 2 and the New Contents dropdown menu that appeared below in teh actions panel only let me select from a list of variables.


So I created two varaibles,

one with with the value foo and another with the value bar


I then added an action to Change Contents of Radio group 2 with the bar-containing variable if radio group 1 Contains B, C, or D. I included an Else condition to Change Contents of Radio group 2 to use the foo-containing variable.


Now when I run the page selecting options B,C,D in group 1 makes the displayed value in Group 2 bar.


But while the simulation is still running, if after that I select option A in group 1, group 2 displays foo AND bar selected, when just foo should be displayed as selected. The value of group 2 is foo then, as it should be.


What actions should I add so that that Group 2 displays bar as UNSELECTED bar if Group 1 contains A?


--Shayne

To update any object on screen, use a "Change contents" action on it. Setting just the variable will change the value, but it won't immediately reflect on the screen.


So, in this case, for the action on the OK button, make the action "Change Contents", the Target should be "Radio Button Group 2", the value would be "Set Text" and the text would be "foo" or "bar", or whatever the name of the radio button is that you want selected.

In case anyone else runs into a similar problem:


The action group that runs based on changes in value to radio group 1 needs to have the following action action aded just after the action that


makes group 2 display the value "bar" if group A's value was b, c, or d (or else display "foo" if group 1's value was A).


the new action to add is


Go to

Web Address

url enter: javascript:window.refresh();

with a 0.6 second delay

Discussions have been disabled for this post