Select to view content in your preferred language

TemplatePicker widget in WAB

685
1
Jump to solution
12-14-2016 04:04 PM
JacobNosal
Deactivated User

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

0 Kudos
1 Solution

Accepted Solutions
JacobNosal
Deactivated User

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.

View solution in original post

0 Kudos
1 Reply
JacobNosal
Deactivated User

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.

0 Kudos