Forum Stats

  • 3,782,958 Users
  • 2,254,716 Discussions


How to use one view model in multiple views using oj.router

3126073 Member Posts: 3
edited Dec 5, 2015 7:23AM in Oracle JET

Hi All,

We've  a use case in which we have one form in 2 pages. We are using oj.router to route to correct views but now we need to have one view model associated with two view.

var router = oj.Router.rootInstance;

  router.configure({'login': {label: 'View Login', value: 'login',isDefault: true},

                    'registration': {label: 'Registration', value: 'registration'},

                    'registrationstep2': {label: 'Registration2', value: 'registration'},

                    'dashboard': {label: 'Dashboard', value: 'dashboard'}


In the code snippet above we are trying to use the same view model for registration and registrationstep2. The route /registeration is rendered correctly but when we click on a button bound with id registerationstep2 the url changes but the view does not.

Please help!