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