saving localstorage value saves wrong thing
the localStorage variable is not getting set
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
the localStorage variable is not getting set
Did you check in Resources tab (dev. tools) -- the variable is not there?
the var is there with no value- it get set with a regular button click- just not with the navbar
Can you post screen shots of the event/action for both button and navbar?
Can you share the app test link with us and tell us how to reproduce the problem?
The problem is that you use mapping. There is 2 components with name "emailLabel" - one is hidden element used for mapping and other is required component with data.
On other hand you cann't use $(this).closest("table") because mailButtonBar is not in the "table" with required label.
I reccomend you to use this code
localStorage.sellerMail = $('[dsid=emailLabel]:visible').text();
':visible' selector gives you only visible Label with data without hidden empty Label.
Use this code for all elements.
Thanks- I am not sure I understand. Are the two components supposed to be there? Or is one not? If there is only supposed to be one emailLabel, I have looked at the page and the mapping and I cannot find a second emailLabel to be removed. Your provided code would be good except that the emailLabel is supposed to be hidden. I only had it visible for troubleshooting this problem.
I thought if the problem is with the name emailLabel, I could use another label and name like emailLabel2 but that does not work either.
When you say "use this code for all elements" and I am not sure what you mean. Does this mean that setting localStorage vars anywhere in app when bound to a screen component that is mapped, is no longer reliable, and should be changed throughout my app? If so, that would be a problem because I use invisible screen items to set localStorage vars throughout my app.
I worked around this particular issue by mapping the localStorage sellerMail to my original database result, but this would not work in other areas of my app. It works here because there is only one result. For example, if I have a list of items retrieved from a database (as in the original post), I display the list, and I click on one I need to set the database id to run a query to retrieve the full details of the database record. As in the original example, I use screen components like labels or inputs to hold that item specific info. Is this the wrong way to do it?
Hi Sean, we will look for a solution it might take some time.