AnsweredAssumed Answered

How to publish data from Query widget supporting file?

Question asked by owenmt8656 on Aug 12, 2020
Latest reply on Aug 12, 2020 by owenmt8656

So I've read the only way to publish data is though the Widget.js because it derives from base widget. My issue is that I would like to publish data from the SingleQueryResult.js in the Query widget. When the user selects a result from the query list I need it to publish data. I read something on being able to grab it from the "Parent Widget" but not sure how to implement this.

      _selectResultTr: function(tr, feature, result, layerDefinition, config) {
        this._unSelectResultTr();
        this.resultTr = tr;
          var currentAttrs = this.getCurrentAttrs();
        var config = currentAttrs && currentAttrs.config;
        var url = currentAttrs.config.url;
        var objectIdField = currentAttrs.config.objectIdField;
        var relationships = this._getCurrentRelationships();
          var feature = tr.feature;
        if (this.resultTr) {
          html.addClass(this.resultTr, 'jimu-state-active');
               
          var wManager = WidgetManager.getInstance();
          var pm = PanelManager.getInstance();   
               
          pm.showPanel(this._getWidgetConfig("PopupPanel")).then(lang.hitch(this, function() {
          this.publishData({
            'target': 'PopupPanel',
            'data': feature.attributes["PARID"]
          });
        }));
                    
            console.log("Result row was clicked " + feature.attributes["PARID"]);

          }
      },

 

Any help on this would be awesome!

Outcomes