Menu navigation Javascript

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Takson
Ebase User
Posts: 3
Joined: Thu May 30, 2013 12:17 pm
Location: Malmesbury
Contact:

Menu navigation Javascript

#1

Postby Takson » Mon Jun 03, 2013 3:39 pm

Hi,

I am new to the platform, just working my way around it and putting together a couple of small example apps at the moment. I have created a 5 page data capture app with a menu, but don't seem to be able to get the menu navigation to trigger off a javascript switch command. I used the example from the help guide but I dont get any activity. here is my code snippet, could someone point me in the right direction?

switch (controls.MAIN_MENU.selected)
{

case "CUSTOMERLIST": form.gotoPage(pages.CUSTOMERS);
break;
case "NEWCUSTOMER": form.gotoPage(pages.NEW_CUSTOMER);
break;

}

Toby
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Mon Jun 03, 2013 5:00 pm

Toby,

Check you've filled in the Item Name property for each of the menu items - this is what I always forget. This is what is returned with the selected property. If this doesn't work, you could always add a log(controls.MAIN_MENU.selected); statement to help debug.

Regards
Jon
0 x

Takson
Ebase User
Posts: 3
Joined: Thu May 30, 2013 12:17 pm
Location: Malmesbury
Contact:

#3

Postby Takson » Mon Jun 03, 2013 5:14 pm

Thanks Jon,

It was both that and I was referencing the Control 1 level down, so the .selected was returning undefined and therefore the switch was not firing either.

All sorted now, thank you.
0 x


Who is online

Users browsing this forum: No registered users and 4 guests