WAB Developer 2.7
Launchpad Theme
Requirement: onOpen of a Web AppBuilder app that contains two or more custom widgets, open a specific widget based upon a url parameter of the deployed WAB.
I'm looking for some design/architecture guidance. We know how to acquire url parameters and their values so this is more of an attempt to understand where we would want to put logic to open specific widget based upon the value of that url parameter.
One idea is to have a "startup" widget whose sole existence is to get the url parameter value and open the other widget using the required logic. (ie. if &urlParamTodo=X then open widget 1, else if &urlParamTodo=Y then open widget 2, else if &urlParamTodo=Z then open widget 3). This seems like the least disruptive approach and could alleviate the need to alter the framework.
But maybe there's an even better way. Any comments or ideas?
Thanks!
Solved! Go to Solution.
James,
That is absolutely the route to go when you are looking to not alter any of the core files like the MapManager.js or ConfigManager.js. You would create an inPanel false widget like the scalebar widget have it get the url parameter like this
var myObject = jimuUtils.urlToObject(window.location.href).query || {};
if (myObject.esearch) {
if(myObject.esearch === "last48"){
//do something
}
}
James,
That is absolutely the route to go when you are looking to not alter any of the core files like the MapManager.js or ConfigManager.js. You would create an inPanel false widget like the scalebar widget have it get the url parameter like this
var myObject = jimuUtils.urlToObject(window.location.href).query || {};
if (myObject.esearch) {
if(myObject.esearch === "last48"){
//do something
}
}
I appreciate your input, Robert! And thanks for the tip/sample.