Jennifer Murphy6032839
Posts: 0
Joined: Wed Jul 10, 2013 8:05 pm

Back Button Event not loading details from radio buttons

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!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Back Button Event not loading details from radio buttons

Hello! Working on it. I'll update.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Back Button Event not loading details from radio buttons

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

Jennifer Murphy6032839
Posts: 0
Joined: Wed Jul 10, 2013 8:05 pm

Back Button Event not loading details from radio buttons

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

Jennifer Murphy6032839
Posts: 0
Joined: Wed Jul 10, 2013 8:05 pm

Back Button Event not loading details from radio buttons

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Back Button Event not loading details from radio buttons

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.

Jennifer Murphy6032839
Posts: 0
Joined: Wed Jul 10, 2013 8:05 pm

Back Button Event not loading details from radio buttons

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Back Button Event not loading details from radio buttons

Jennifer,

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

Jennifer Murphy6032839
Posts: 0
Joined: Wed Jul 10, 2013 8:05 pm

Back Button Event not loading details from radio buttons

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?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Back Button Event not loading details from radio buttons

Hi Jennifer,

Yes, for the whole group.

Return to “Issues”