I was reading about route configuration, and I figured out how to make a parameter optional.
But what I cannot find is how to add the parameter to the URL based on a form value.
Use case: I’ve got a form where the user will enter some data to look up a customer.
I’d like to have the customer number be put into the url, so they can use that url to reload that specific customer.
How do I add a value from the form to the url so this can happen?
Here’s my route configuration in app.js:
configureRouter( config, router )
{
config.title = 'ARIS';
config.options.pushState = true;
config.options.root = '/';
config.map([
{
route: '',
name: 'home',
moduleId: PLATFORM.moduleName('home'),
nav: true,
title: 'Home',
},
{
route: 'login',
name: 'login',
moduleId: PLATFORM.moduleName('login'),
nav: false
},
{
route: 'customer/:debtor_id?',
name: 'customer',
moduleId: PLATFORM.moduleName('customer'),
nav: true,
href: 'customer',
title: 'Customer',
activationStrategy: activationStrategy.invokeLifecycle,
settings: {dropdown: true}
},
{
route: 'report_as/:aris_id',
name: 'report_as',
moduleId: PLATFORM.moduleName('report_as'),
nav: false,
title: 'Report As',
// activationStrategy: activationStrategy.invokeLifecycle,
},
{
route: 'search',
moduleId: PLATFORM.moduleName('search'),
nav: true,
title: 'Search/Worklist',
settings: {dropdown: true}
},
]);
config.mapUnknownRoutes('home');
config.fallbackRoute('home');
this.router = router;
}