Thomas7072266
Posts: 0
Joined: Thu Aug 28, 2014 6:25 pm

I am unable to save values from select components into localstorage and vice versa

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

Thomas7072266
Posts: 0
Joined: Thu Aug 28, 2014 6:25 pm

I am unable to save values from select components into localstorage and vice versa

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 .....

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

I am unable to save values from select components into localstorage and vice versa

Hi Thomas,

Thank you for reporting this issue, we'll fix it.

Thomas7072266
Posts: 0
Joined: Thu Aug 28, 2014 6:25 pm

I am unable to save values from select components into localstorage and vice versa

Do you have a time frame for when this bug will be fixed ?
Thanks
Thomas

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

I am unable to save values from select components into localstorage and vice versa

Hi Thomas,

It will be fixed in the nearest release (we expect in the end of September).

Thomas7072266
Posts: 0
Joined: Thu Aug 28, 2014 6:25 pm

I am unable to save values from select components into localstorage and vice versa

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

Thomas7072266
Posts: 0
Joined: Thu Aug 28, 2014 6:25 pm

I am unable to save values from select components into localstorage and vice versa

Uupdate == I am talkinf about 2 select/pulldowns on the same page

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

I am unable to save values from select components into localstorage and vice versa

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.

Thomas7072266
Posts: 0
Joined: Thu Aug 28, 2014 6:25 pm

I am unable to save values from select components into localstorage and vice versa

Thankyou
works perfectly
Now I'm happy
:-)

Abhijeet Singh
Posts: 0
Joined: Thu May 08, 2014 5:54 pm

I am unable to save values from select components into localstorage and vice versa

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.

Return to “Issues”