Page 2 of 3

How to determine the state of a toggle switch?

Posted: Wed Jul 31, 2013 3:49 pm
by Kateryna Grynko

Hi John,

This is a bug.
As a workaround add the following JavaScript code on Page Show event:

codeAppery( "mobiletoggle_23" ).val( localStorage.getItem( "toggle_state" ) ).slider( "refresh" );/codewhere localStorage.getItem( "toggle_state" ) stores "on" or "off".


How to determine the state of a toggle switch?

Posted: Wed Jul 31, 2013 4:44 pm
by John Herdean

ok good that worked. Let me know when the standard way works again


How to determine the state of a toggle switch?

Posted: Sat Aug 03, 2013 12:09 am
by John Herdean

Hello, Im running into the same problems with the SelectMenus (the single selection - for this im looking just to have the item selected according to the localstorage value), and radio buttons. Please let me know how to set these two types as well? Thanks


How to determine the state of a toggle switch?

Posted: Sat Aug 03, 2013 12:14 am
by John Herdean

also, is there any documentation or tutorials on all the different types of components how to set them by JS?


How to determine the state of a toggle switch?

Posted: Sat Aug 03, 2013 12:15 am
by maxkatz

jquerymobile.com is your source for this.


How to determine the state of a toggle switch?

Posted: Sat Aug 03, 2013 12:48 am
by John Herdean

i tried looking at their site and its so confusing. They have a long list of Articles & Tutorials (which im guessing is the closest to what im looking for) and nothing is organized. I cant find anything from there. Ill probably spend all nite on their site and still be stuck - thats how confusing it is.

For the selectmenu im guessing its:

Appery( "selectmenu_name" ).val( localStorage.getItem( "select_value" ) ).selectmenu ( "refresh" );

and for the radiobutton im guessing its:

Appery( "radiobutton_name" ).val( localStorage.getItem( "radio_value" ) ).radiobutton ( "refresh" );

Are those right? thanks


How to determine the state of a toggle switch?

Posted: Sat Aug 03, 2013 12:50 am
by John Herdean

and i would try to test them but the testing site is down again for past hour almost. its not updating the changes. It seems the testing site is up and down all day long


How to determine the state of a toggle switch?

Posted: Sat Aug 03, 2013 1:32 am
by John Herdean

well, the testing is back i guess. It doesnt look like the my radiobutton line worked i get this error from firebug:

TypeError: Appery(...).val(...).radiobutton is not a function

And something is strange for the textinput because it has no issues like this:

Appery('current_password').val('').textinput('refresh');

but, when i write it like this:

Appery('llm3_first_name').val(localStorage.getItem('first_name')).textinput('refresh');

it throws this error:

Error: no such method 'refresh' for textinput widget instance

Please help with this 2 issues. Thanks.


How to determine the state of a toggle switch?

Posted: Sat Aug 03, 2013 2:03 am
by Alena Prykhodko

Did you test it?
codeAppery('llm3_first_name').val(localStorage.getItem('first_name')).textinput('refresh'); /code works as expected.


How to determine the state of a toggle switch?

Posted: Sat Aug 03, 2013 2:25 pm
by John Herdean

yes firebug gives me this error:

Error: no such method 'refresh' for textinput widget instance