Select to view content in your preferred language

Is there a print complete event in ArcGIS JavaScript 4.x

2717
16
Jump to solution
08-30-2019 12:13 PM
DanielWebb
Frequent Contributor

In ArcGIS JavaScript 3.x, there was an event for print-complete.

https://developers.arcgis.com/javascript/3/jsapi/print-amd.html#events

Does 4.x have that?  Or is there a way to see when the print widget has completed?

I noticed the Print widget in 4.x has the method 'hasEventListener()' but I can't figure out how it works.

Thanks!

0 Kudos
16 Replies
RobertScheitlin__GISP
MVP Emeritus

Daniel,

   I doubt this issue has anything to do with the code I provided. You need to get your print service issue figured out first.

0 Kudos
DanielWebb
Frequent Contributor

I don't know. I keep trying other peoples' print services and get the same result.  Do you think it's a print service setting somewhere?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Are you having this issue when you do not specify a print service url and it defaults to Esri’s print service? If so then you have a internal network issue that is blocking something.

0 Kudos
DanielWebb
Frequent Contributor

Got busy with some stuff and this is the first chance I've had to circle back around to this.

Yes, it still does it with Esri print services. If I don't specify a 'printServiceUrl' it gives a message in the div "There seems to have been an error."

When I specified a url with this one (https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task), it did the same as before.  It finished "printing" but would not open.

I'm not a network guy, nor do I have permissions to that part of our IT architecture. Is there a particular setting you think I'm missing? Do you think it's something in ArcGIS Manager or Portal?

I'll mark the code as answered.  Thanks.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Daniel,

   This is tough to diagnose as on my network using esri's print service I do not have that issue at all. Seems like your network is blocking something. Not sure what to tell you.

0 Kudos
Noah-Sager
Esri Regular Contributor

Update: we will be updating the documentation for PrintViewModel.state values (complete is not working as Robert noted above) and consider adding a complete event to the Print widget at a future release.

Thank you to Robert for posting the workaround, and thank you to Daniel for bringing this issue to our attention.

0 Kudos
Noah-Sager
Esri Regular Contributor

Double update: we will be adding a "complete" event to the print widget at 4.17 (early October 2020) that will make this all much easier to handle.