Page 1 of 3
saving localstorage value saves wrong thing
Posted: Tue Apr 09, 2013 1:30 pm
by Sean Kelley
I am using the list item for the first time and I have a problem setting the correct value for a local storage variable when clicking on a list item. I have the list item in a grid. It is populated with a rest response which works. I have a label (also tried input) above the list item to get the database id # of the item (which displays correctly). I then set the label value to a local storage variable when the list item is clicked. The problem is that the id value is not set to the label value I see on screen, but rather the title of the list item itself. I am not sure if this is a really silly mistake on my part or something about list item I don't understand. Any ideas?
saving localstorage value saves wrong thing
Posted: Tue Apr 09, 2013 1:54 pm
by Maryna Brodina
Hello! Could you clarify ho did you set localStorage variable? Screenshot or some code you use would help.
saving localstorage value saves wrong thing
Posted: Tue Apr 09, 2013 2:33 pm
by Sean Kelley
Here is the click event where horseIdLabel value is supposed to be assigned to horseId localstorage variable:
Here is the app running with horseID set to favListItem's text value not the id#:
saving localstorage value saves wrong thing
Posted: Tue Apr 09, 2013 2:37 pm
by Sean Kelley
by the way-horseIdLabel and horseId do not match on screen because it is not set until clicked but you can at least see the horseIdLabel displayed above list item
saving localstorage value saves wrong thing
Posted: Tue Apr 09, 2013 5:28 pm
by Kateryna Grynko
Hi Sean,
We've tested. This is our bug.
Error will disappear when you don't use Mobile List.
saving localstorage value saves wrong thing
Posted: Tue Apr 09, 2013 7:18 pm
by Sean Kelley
Hi
I am not sure I understand. Are you saying it can not be fixed? Isn't the list item a key mobile UI item to the degree that apple likes to see it in apps to show a level of visual attractiveness- ie approval for the app store? I can switch to using only a grid with basic buttons but it not nearly as attractive.
I do not need to sort, count, etc. Is there another way to achieve a similar visual buttonless result while still setting localstorage vars on click of the whole area? It seems like if you could not set a localstorage variable at all on click it would render the list item quite unusable in tiggzi
saving localstorage value saves wrong thing
Posted: Tue Apr 09, 2013 7:42 pm
by Kateryna Grynko
Sean,
This is a very specific and uncommon problem. This is only for Mobile List inside of Grid if array is mapped to it. The bug will be fixed as soon as possible.
As a workaround you can replace Action "Set LocalStorage Variable" with the following JavaScript:
codelocalStorage.horseId = $(this).closest("table").find('[name=horseIdLabel]').text();/code
saving localstorage value saves wrong thing
Posted: Wed Apr 10, 2013 12:33 pm
by Sean Kelley
Thanks for the workaround Katya! I am trying to understand the uses for list- other than static content it would seem unworkable without setting the localstorage var to know where the list item takes you on click. Incidentally, my list is mapped to rest service results (I guess that is essentially an array). No need to respond to me thinking out loud on the uses for list.
saving localstorage value saves wrong thing
Posted: Tue May 07, 2013 10:04 pm
by Sean Kelley
I have another problem setting a localStorage variable which is unrelated to a mobile list. I have a page with an input on it and a navbar button that is supposed to set a localStorage var when clicked (appery 'Set local storage variable'). It worked fine before the big upgrade of Tiggzi/Appery. I then worked on some other things and came back to it and it no longer works. I tried to use a javascript workaround similar to the one above but I cannot get it to work.
I tried:
localStorage.sellerMail = $(this).closest("table").find('[name=emailLabel]').text();
Incidentally, emailLabel displays ok on page, and a regular button that I was using previously (now hidden), to set the localStorage variable sellerMail to emailLabel's value works fine.
How can I get this working again?
saving localstorage value saves wrong thing
Posted: Wed May 08, 2013 12:21 am
by maxkatz
What exactly is not working?