In flex, I was able to host multiple configurations under the core application by using
index.html?config=myconfig.xml
So, different layers and tools would be loaded depending which xml was called.
Is there any way in web appbuilder to do a similar task?
To build an app that depending the url parameter (xml or ?) to attach the appropriate layers and tools.
Thanks.
Solved! Go to Solution.
Robert, just to verify of what I am thinking.
It will not work exactly how it was working with Flex. It takes an extra step.
If you are using the Local Layer widget where you define your own services along with the definition expressions, then:
- will be multiple "config_Local Layer Widget.json" files for every group of layers and definition expressions
- for every config.json file (config2.json, config3.json....) it will point to the appropriate (config_Local Layer Widget2.json, config_Local Layer Widget3.json,...)
In a word, since all widgets will be the same for every config, all config.json files will be identical, except the line that calls the configuration file for the Local Layer.
Please verify. Thank you for all your help.
Lefteris,
Sure it is identical to the way you did it in Flex. It is just a .json instead or .xml
Just out of curiosity, how would one make a widget that would allow the user to choose between configurations?
Robert, just to verify of what I am thinking.
It will not work exactly how it was working with Flex. It takes an extra step.
If you are using the Local Layer widget where you define your own services along with the definition expressions, then:
- will be multiple "config_Local Layer Widget.json" files for every group of layers and definition expressions
- for every config.json file (config2.json, config3.json....) it will point to the appropriate (config_Local Layer Widget2.json, config_Local Layer Widget3.json,...)
In a word, since all widgets will be the same for every config, all config.json files will be identical, except the line that calls the configuration file for the Local Layer.
Please verify. Thank you for all your help.
Leferis,
That is how I've used it for my application. The only difference between the config files is the config_Local Layer widget name/location.
Bingo. Thanks.
Also - as a side note, I've used a modification of the About widget and pre-coded in the href's for these configurations so as to have an "event switcher" functionality. Each of these links have a specific url that they point to, following the rule of "config=configx.json".
I used a different approach. I created a combo box in the header widget then the users can switch to the different configs. Thanks.