Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using ojbutton for "back button" or "go to" navigation

3241484May 18 2016 — edited May 25 2016

Hi,

I have been trying to create a buttons for my hybrid JET mobile application, one of these buttons is to be used as a back button, the other is to be used to go to another page in the application. My route is set up in a file called appController.js and looks like this:

// Router setup

       self.router = oj.Router.rootInstance;

       self.router.configure({

         'search': {label: 'Search', isDefault: true},

         'results': {label: 'Results'},

         'item': {label: 'Item'}

       });

       oj.Router.defaults['urlAdapter'] = new oj.Router.urlParamAdapter();

       // Navigation setup

       var navData = [

         {name: 'Search', id: 'search'},

         {name: 'Results', id: 'results'},

         {name: 'Item', id: 'item'}

       ];

       self.navDataSource = new oj.ArrayTableDataSource(navData, {idAttribute: 'id'});

       self.navChangeHandler = function (event, data) {

         if (data.option === 'selection' && data.value !== self.router.stateId()) {

           self.toggleDrawer();

           self.router.go(data.value);

         }

       };

         }

       };

My question is - how would I create two buttons on the "results" page that would allow the user to go back (to the search screen) or to "go" to the item page?

I've tried just using a href tag to direct navigation how ever this doesn't work well with a Cordova hybrid application within iOS and I'm thinking there must be a cleaner way to do this just using the router? I've seen similar examples on the "work better" application, for example the main screen creates an app link using the persons profile picture.

Any advice would be appreciated as my router seems to differ to the Work Better application and I'm struggling to apply that logic to my application.

Thanks

This post has been answered by John JB Brock-Oracle on May 25 2016
Jump to Answer
Comments
Post Details
Added on May 18 2016
1 comment
1,037 views