AnsweredAssumed Answered

Pushing Data From eSearch to Custom Print Template

Question asked by deleted-user-FTxtuSQd67Ur on Sep 1, 2016
Latest reply on Nov 30, 2016 by alecosci

Okay, so I had asked this question before in regards to widget communication and we seemed to get that to work (with the _onSearchFinish and onReceiveData functions in the eSearch and Print widgets, respectively).  The widgets are communicating but now we are stuck on how exactly to take the data that we have pushed to the print widget and then send that data from the Print widget to populate custom text elements that we have in our "Export Web Map" print service that we attached to the Print widget.


We had this working in our old Javascript application and we think we are missing that part where we define our custom text elements but we are unsure of where to define them and what function we would use to do so.


eSearch: (example of pushing a parcel number from the eSearch to the Print widget):


_onSearchFinish: function (layerIndex, closeOnComplete, removing, adding, results) {
if(results.features.length === 1){
'target': 'Print',
'parcel': { "parcel_id": results.features[0].attributes.Parcel___}
}, true);


Print (this would go in the widget.js):


onReceiveData: function(name, source, params,historyData) {

(have no idea what would go after this)


further customization would be needed in the Print.js I am assuming but yet again we do not know exactly how to define our custom text elements so that the Print widget will send them to our print service so they are recognized to populate them in the templates.