Page 1 of 1

Switch Statement for List control

Posted: Tue Jan 10, 2017 8:12 pm
by Mike Kastens

I am trying to perform a switch statement on a selectable list. My list items are names that change based on a search. After the search, the list contains only one list item corresponding to the search. I then need to navigate to the appropriate page based on the name on the list item. The code I have below is not working. Any help would be much appreciated.

var screenName = "";

switch(location) //location is the name of my list control
{
case "John Doe": //"John Doe" being the name that would be on list item
{
screenName = "John_Doe"; //already existing page names
break;
}
case "Mike Smith":
{
screenName = "Mike_Smith";
break;
}
}
Apperyio.navigateTo(screenName);


Switch Statement for List control

Posted: Tue Jan 10, 2017 9:29 pm
by Serhii Kulibaba

Hello Mike,

Your code looks correct.
Please check if there are any errors in the browser console. You can learn here: https://docs.appery.io/docs/using-bro... how to open the console.