AnsweredAssumed Answered

update entries on form select based on layer list

Question asked by lkoumis on Mar 21, 2017
Latest reply on Mar 22, 2017 by lkoumis

I have a widget A that adds layers on the map.

 

Then, it calls widget B which opens with:

 getallLAyers:function(){
          LayerInfos.getInstance(this.map, this.map.itemInfo).then(lang.hitch(this, function (layerInfosObject) { 
               layerInfosObject.getLayerInfoArray().forEach(lang.hitch(this, function(layerInfo,index){
                    if (layerInfo.getUrl() != null){
                    option = {
                         value: index,
                         label: layerInfo.title,
                         myurl: layerInfo.getUrl()
                    };
                    console.log(option.myurl);
                    this.resultLayers.push(option);
                    }
               }));
          }));      
          
     },

and the resultLayers array populates a  select dropdown.

 

If  widget A adds another layer on the map, even if widget A closes and reopens widget B, the widget B does not update the entries of the select with the new layers. Ideas?  Thank you.

Outcomes