Hello All,
I am trying to include the esri/dijit/editing/TemplatePicker widget in my WAB widget, but am having a problem. The documentation states that:
"The TemplatePicker must be created and started inside the onLoad event of the map or the layer for which it is associated."
However, WAB loads the portal map far before my widget can be opened. How can I access this event or otherwise use the TemplatePicker widget?
Thank you for your help!
Regards,
Jacob Nosal
Solved! Go to Solution.
It seems as though the documentation is incorrect. Including an array of FeatureLayers outside of the onLoad event works.
templatePicker = new TemplatePicker({
featureLayers: [
this.map.getLayer(this.map.graphicsLayerIds[0]),
this.map.getLayer(this.map.graphicsLayerIds[1]),
this.map.getLayer(this.map.graphicsLayerIds[2])
]
}, templateNode);
templatePicker.startup();
This code is working for me.
It seems as though the documentation is incorrect. Including an array of FeatureLayers outside of the onLoad event works.
templatePicker = new TemplatePicker({
featureLayers: [
this.map.getLayer(this.map.graphicsLayerIds[0]),
this.map.getLayer(this.map.graphicsLayerIds[1]),
this.map.getLayer(this.map.graphicsLayerIds[2])
]
}, templateNode);
templatePicker.startup();
This code is working for me.