Page 1 of 1

Back Button Event not loading details from radio buttons

Posted: Mon Jul 15, 2013 10:57 am
by Jennifer Murphy6032839

My app is a form, each page captures some important data. I want the user to be able to use the back button and have the functionality to edit some of previous inputs.

It is currently working with input fields, so when the user clicks the back button to return to the previous screen all the information is still in the input fields. However, I can't get this working for pages that have radio buttons.

Perhaps, there is a problem with how I am saving the radio button data into local storage variables, I have tried numerous combinations but nothing is working.

Component = injury
event = selected/input/value change etc? (I am not sure which one to select?)
action = set local storage variable
details = property name = selected

I hope my problem is clear!


Back Button Event not loading details from radio buttons

Posted: Mon Jul 15, 2013 1:26 pm
by Maryna Brodina

Hello! Working on it. I'll update.


Back Button Event not loading details from radio buttons

Posted: Mon Jul 15, 2013 3:00 pm
by Kateryna Grynko

Hi Jennifer,

There is a bug in builder, so "set local storage variable" doesn't work for radio buttons. We suggest you the following workaround:

1) to save selected radio button run:
codelocalStorage.setItem("selectedRadioButtonId", $('[name=mobileradiogroupName]:checked').attr('id'));/code
2) to restore run:
code$('#' + localStorage.getItem("selectedRadioButtonId")).attr("checked", true);
$('[name=mobileradiogroupName]').checkboxradio("refresh");/code


Back Button Event not loading details from radio buttons

Posted: Mon Jul 15, 2013 3:02 pm
by Jennifer Murphy6032839

Ok thanks for letting me know! I will try this!


Back Button Event not loading details from radio buttons

Posted: Tue Jul 16, 2013 2:15 pm
by Jennifer Murphy6032839

So I have 2 radio buttons in the same group, so do I need created 2 events or can I have just one per group?

Also

Is the component = group or individual radio button ID?
Is the event = selected?
and Action = Run Javascript?

Thanks,
Jen


Back Button Event not loading details from radio buttons

Posted: Tue Jul 16, 2013 5:28 pm
by Kateryna Grynko

HI Jennifer,

You can create an only action for the whole group. Then you'll have to define in JavaScript code what item was clicked. You can do this using the passed argument - arguments[0].target.

You won't face such problem using independent handlers.


Back Button Event not loading details from radio buttons

Posted: Tue Jul 16, 2013 5:31 pm
by Jennifer Murphy6032839

Would you please be able to give me a full version on this code and how it differs from the above example please?


Back Button Event not loading details from radio buttons

Posted: Tue Jul 16, 2013 7:55 pm
by Kateryna Grynko

Jennifer,

On Value Change event add Run JavaScript action where get selected item value using the following code:
codearguments[0].target.value/code


Back Button Event not loading details from radio buttons

Posted: Fri Aug 02, 2013 9:38 am
by Jennifer Murphy6032839

I have still been unable to get this working, I am not sure what I am doing wrong.

So I run this script for the collection of radio buttons not one per radio button?


Back Button Event not loading details from radio buttons

Posted: Fri Aug 02, 2013 9:50 pm
by Kateryna Grynko

Hi Jennifer,

Yes, for the whole group.