Skip to content Skip to sidebar Skip to footer

Ibm Worklight - Unable To Navigate Between Views

I am trying to develop a simple app that consist of multiple scrollable views, but the navigation between views like from 'Home' view to 'view1' is not working. Unable find out the

Solution 1:

You're missing quotes around the ID in your moveTo. For example:

<li data-dojo-type="dojox.mobile.TabBarButton" icon="images/Arrow-turn-right-icon.png"data-dojo-props="moveTo:view1">Label</li>

Should become:

<li data-dojo-type="dojox.mobile.TabBarButton" icon="images/Arrow-turn-right-icon.png"data-dojo-props="moveTo:'view1'">Label</li>

That way it will work, I tested it out on JSFiddle (I used image placeholders). The best way to know if you need quotes is by checking the API documentation. If you look at the moveTo property, you will notice that is has an [S] icon in front of it, which means it's a String (and Strings do need quotes).

Solution 2:

The below example code is built on top of the one provided to you in this question; This time around views are added inside the scrollableView and you move between them using the moveTo attribute, as well as using the selected attribute to pick a default view to display inside the scrollableView.

Example code:http://pastebin.com/SD0SU3wV

Documentation:

Edit: Dimitri's answer pinpoints to your exact error, mine simplifies the example a bit... I'd go with his. :-)

Post a Comment for "Ibm Worklight - Unable To Navigate Between Views"