I had a user that was not seeing all of the options in the print widget, namely the advanced button and title, etc - print button does show up. Once I noticed they were using Chrome 52, I upgraded and that is the problem. I haven't found any other widgets that have been affected yet. The Print widget tries to load and then I get a time out message. It does work properly in IE11. As half my users are on Chrome - not good.
Is there a fix for this? Has anyone else noticed? Would upgrading to WAB DE 2.1 fix the issue?
Solved! Go to Solution.
Lee,
It is affecting 1.3, 2.0 and 2.1 sites. The workaround if to setup a proxy (if you have not dome so yet) and modify the Print.js file to have the _getPrintTaskInfo function esriRequest to use the proxy (line 17).
_getPrintTaskInfo: function() { // portal own print url: portalname/arcgis/sharing/tools/newPrint var def = new Deferred(); if (this._isNewPrintUrl) { // portal own print url def.resolve({ isGPPrint: false }); } else { esriRequest({ url: this.printTaskURL, content: { f: "json" }, callbackParamName: "callback", handleAs: "json", timeout: 60000 },{useProxy: true, usePost: false}).then(lang.hitch(this, function(data) { def.resolve({ isGPPrint: true, data: data }); }), lang.hitch(this, function(err) { def.resolve({ error: err }); }) ); } return def; },
Lee,
It is affecting 1.3, 2.0 and 2.1 sites. The workaround if to setup a proxy (if you have not dome so yet) and modify the Print.js file to have the _getPrintTaskInfo function esriRequest to use the proxy (line 17).
_getPrintTaskInfo: function() { // portal own print url: portalname/arcgis/sharing/tools/newPrint var def = new Deferred(); if (this._isNewPrintUrl) { // portal own print url def.resolve({ isGPPrint: false }); } else { esriRequest({ url: this.printTaskURL, content: { f: "json" }, callbackParamName: "callback", handleAs: "json", timeout: 60000 },{useProxy: true, usePost: false}).then(lang.hitch(this, function(data) { def.resolve({ isGPPrint: true, data: data }); }), lang.hitch(this, function(err) { def.resolve({ error: err }); }) ); } return def; },
That works for Developer Edition Apps, but what about those that are built using AGOL WAB?
You need to contact esri tech support and see if they can resolve this issue
Thank you Robert, you saved the day again. I had to go through all the steps to set up the proxy first, but finally got all my apps back up and running. BTW - esri support thinks you are a legend!
For anyone looking for the information on how to set up a proxy - here are the links:
Setting up a Proxy | Support Services Blog
Setting up a proxy with Web AppBuilder Developer Edition | Support Services Blog
My workflow now is to download the code from WAB, then edit the config.json and print.js files.
Since I did not utilize secure services for this site, I did not have specific rules to add in the config.json inside the [].
I'm trying to set up a proxy as well, I don't have any secure services, so do I need the Client Id's and app Id's still?
I haven't registered any of my applications, I just host them on a server.
To configure just the print widget to work properly, I did not use Client IDs or App IDs, I don't believe. Here is what I wrote down for myself.
// for proxy.config file
<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*"
mustMatch="false">
<serverUrls>
<serverUrl url="http://mydomain.com"
matchAll="true"/>
</serverUrls>
</ProxyConfig>
<!-- See https://github.com/Esri/resource-proxy for more information -->
//in the config.json file:
//scroll to bottom about line 518: make sure httpProxy is set to:
},
"wabVersion": "2.0.1",
"isTemplateApp": true,
"isWebTier": false,
"httpProxy": {
"useProxy": true,
"alwaysUseProxy": false,
"url": "http://yourdomain.com/folder/Proxy/proxy.ashx",
"rules": []
//And in the widgets\print\print.js file: about line 187 is set to useProxy
_getPrintTaskInfo: function() {
// portal own print url: portalname/arcgis/sharing/tools/newPrint
var def = new Deferred();
if (this._isNewPrintUrl) { // portal own print url
def.resolve({
isGPPrint: false
});
} else {
esriRequest({
url: this.printTaskURL,
content: {
f: "json"
},
callbackParamName: "callback",
handleAs: "json",
timeout: 60000
},{useProxy: true, usePost: false}).then(lang.hitch(this, function(data) {
def.resolve({
isGPPrint: true,
data: data
});
}), lang.hitch(this, function(err) {
def.resolve({
error: err
});
})
);
}
return def;
},
or you can just set the mustMatch parameter to be false in the proxy.config and no need to have any serverurl
Robert is a living legend
We have a patch for WAB for this specific issue with Chrome 51
2.0 - Web AppBuilder 2.0 patch for Chrome51