Page 1 of 2
I am unable to save values from select components into localstorage and vice versa
Posted: Thu Aug 28, 2014 6:37 pm
by Thomas7072266
Hello
I think this may be a bug ... I have an application with 3 pages and a select component and navigation buttons on each page.
On page1 the select component is connected via Value Changed event to a local storage variable and page1 onLoad reads the localstorage variable to set the select component.. When I change pages and return to the first page the select component is updated with the saved value (from localStorage).
However on the other 2 pages where I have put separate select components they are not getting set correctly when I switch between pages.
I will shre the project so that you may see what I mean
Thanks
Thomas
I am unable to save values from select components into localstorage and vice versa
Posted: Thu Aug 28, 2014 6:57 pm
by Thomas7072266
Nevermind 
The solution was to select App Settings - General -
"Render all pages in one HTML file (jQuery Mobile multi-page template)"
The application also seems to respond faster .....
I am unable to save values from select components into localstorage and vice versa
Posted: Thu Aug 28, 2014 7:42 pm
by Kateryna Grynko
Hi Thomas,
Thank you for reporting this issue, we'll fix it.
I am unable to save values from select components into localstorage and vice versa
Posted: Thu Aug 28, 2014 7:55 pm
by Thomas7072266
Do you have a time frame for when this bug will be fixed ?
Thanks
Thomas
I am unable to save values from select components into localstorage and vice versa
Posted: Thu Aug 28, 2014 8:02 pm
by Kateryna Grynko
Hi Thomas,
It will be fixed in the nearest release (we expect in the end of September).
I am unable to save values from select components into localstorage and vice versa
Posted: Fri Aug 29, 2014 7:10 pm
by Thomas7072266
Hi Katya
OK you say there is a bug ..... I am unhappy 
I have been trying to get 3 different Select pull-downs to work on my webapp .... and I can only ever get 1 pull-down to set the property from a local variable and to update from a local variable ..... it doesn't matter whether its Jquery Mobile multi page template or not .... the other 2 selects are defined identically using differnt names and different localStorage variables etc .....
Can you tell me if this is a know bug described somewhere and whether there is a workaround ..
I would appreciate knowing whether I am doing something wrong or not.
Thanks
Thomas
I am unable to save values from select components into localstorage and vice versa
Posted: Fri Aug 29, 2014 7:11 pm
by Thomas7072266
Uupdate == I am talkinf about 2 select/pulldowns on the same page
I am unable to save values from select components into localstorage and vice versa
Posted: Fri Aug 29, 2014 8:30 pm
by Kateryna Grynko
Hi Thomas,
Here is a workaround for you.
Instead of Set property action run JavaScript with the following code:
preAppery("mobileselectmenu_15").find('[value="'+localStorage.getItem("lsvName")+'"]').prop("selected", true);
Appery("mobileselectmenu_15").selectmenu("refresh");/preWhere mobileselectmenu_15 is a select component name,
lsvName is a name of localStorage variable containing the value.
I am unable to save values from select components into localstorage and vice versa
Posted: Fri Aug 29, 2014 10:14 pm
by Thomas7072266
Thankyou
works perfectly
Now I'm happy

I am unable to save values from select components into localstorage and vice versa
Posted: Sun Mar 08, 2015 4:11 am
by Abhijeet Singh
Can you PLEASE give me the code for this "....... page1 onLoad reads the localstorage variable to set the select component....." for both the label and value of the select component.