neuronhighway9522
Posts: 0
Joined: Sun Oct 19, 2014 2:42 am

LIst going to different pages based on db value via storage

I have a list on a page that has several items. I have sent all the values to storage before loading them into tabels for the list item specifics. on the page including the name of the page it should navigate next to hidden in a non visible label. There are approximately ten different pages that are locations all are stored in the database and in the request/response parameters..

So how do I:
navigate to a page based on a db value that is in local storage and on the page?

I tried this
var pageLocation = Apperyio.('mobilelabel_pageLocation').val();
navigateTo(value);

invoked on click of the mobilelist item.

sadly that did not work so any ideas?

Then I tried this...if(localStorage.getItem('pageLocation')== Apperyio.('mobilelabel_pageLocation'){Apperyio.navigateTo("value");}
else{
} nope so anybody can help a newbie out?

Thanks!

neuronhighway9522
Posts: 0
Joined: Sun Oct 19, 2014 2:42 am

LIst going to different pages based on db value via storage

very helpful!

I am putting the values into storage. Got it!

QUESTION

I have the navigateTo page name in that storage. so how do I write on virtualclick of the list item to navigate to a pageName based on the value I have stored?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

LIst going to different pages based on db value via storage

Please use JS below for that:

prevar pageName = Apperyio.storage.pageName.get();
Apperyio.navigateTo(pageName);/pre

here pageName - name of the Storage variable, which contains the name of the page, needed to open.

neuronhighway9522
Posts: 0
Joined: Sun Oct 19, 2014 2:42 am

LIst going to different pages based on db value via storage

Trying to implement but having a bit of trouble... I think the problem is on the element on ... if I am using the virtual click instead of click does that matter?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

LIst going to different pages based on db value via storage

You can use any event you want for that. But you have to know virtual click may work a little bit differ http://stackoverflow.com/questions/12...
So it is better to use click or tap events instead of virtual click

neuronhighway9522
Posts: 0
Joined: Sun Oct 19, 2014 2:42 am

LIst going to different pages based on db value via storage

hey if anyone else needs this answer/// heres the code that worked for me...

i passed the two values ( the task id and the page name I wanted it to go to next....)

  1. first mapping the array to storage

  2. then to the list on page via the labels....

  3. you dont need the alert but good to have to check several values in the list to make sure they are actually going to a new page before deleting... also I leave the labels visible until Im sure everything is working and then uncheck the visible settings for the particular label on the UI.....

    Heres the code to use on click of list item//

    Apperyio.storage.task_id.set($(this).find("[name=mobilelabel_assignmentNumber]").text());
    Apperyio.storage.pageLocationPointer.set($(this).find("[name=mobilelabel_pageLocation]").text());
    var storageValue = Apperyio.storage.pageLocationPointer.get();
    alert("storageValue = " + storageValue);
    Apperyio.navigateTo(storageValue);

Return to “Issues”