Chrome 52 and WAB 2.0 DE site - Print widget does not show advanced options

5863
18
Jump to solution
08-08-2016 09:47 AM
LeeAllen
Occasional Contributor

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.

Property Search

Is there a fix for this? Has anyone else noticed?  Would upgrading to WAB DE 2.1 fix the issue?

Tags (2)
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

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;
    },

View solution in original post

18 Replies
RobertScheitlin__GISP
MVP Emeritus

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;
    },
MichaelMiller2
Occasional Contributor III

That works for Developer Edition Apps, but what about those that are built using AGOL WAB?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

You need to contact esri tech support and see if they can resolve this issue

LeeAllen
Occasional Contributor

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 [].

LeoLadefian5
Occasional Contributor II

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.

0 Kudos
LeeAllen
Occasional Contributor

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;
},

ErwinSoekianto
Esri Regular Contributor

or you can just set the mustMatch parameter to be false in the proxy.config and no need to have any serverurl 

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Robert is a living legend

ErwinSoekianto
Esri Regular Contributor

We have a patch for WAB for this specific issue with Chrome 51

2.0 - Web AppBuilder 2.0 patch for Chrome51 

1.3 - https://community.esri.com/docs/DOC-8391 

1.2 - Web AppBuilder 1.2 patch for Chrome 51.0.2704.63