Select to view content in your preferred language

Print Dijit works in sandbox but not in html...?

2412
13
03-26-2014 11:27 AM
ralphholmes
Occasional Contributor
Greetings All,

So I have been working on building a java script API map for some time now and I am at a point where I am trying to add in a print template. I have been working off of the samples provided and get the print drop down button to display and function as it should in my application when working in the ArcGIS API for java script sandbox...

However when I take the same code back into my HTML document and test it the button does not appear at all...

It also seems that if I take the sample codes provided into an html document and test them they produce the same effect. The print button does not display at all.

This is the only issue that I am having with my API at this time.

I can post code segments if needed but the print functionality is verbatim from sample provided from

https://developers.arcgis.com/javascript/jssamples/widget_print_esri_request.html

Thanks for your help with this issue.
0 Kudos
13 Replies
JeffPace
MVP Alum
I feel like you are skipping alot of steps, you can not just change a line of code and expect this to work.

You need to download the proxy.php page, add it to your application at the same location as your index.html page, and configure the proxy to access the locations you want access to

More information on configuring a proxy can be found at

https://developers.arcgis.com/javascript/jshelp/ags_proxy.html

specifically

" Download the appropriate proxy for your platform from GitHub. Each proxy download includes installation instructions and information on any system requirements make sure you follow these instructions in order to setup and configure the proxy on your web server."
0 Kudos
ralphholmes
Occasional Contributor
alright i'll take a look...
0 Kudos
JeffPace
MVP Alum
your code is pointing (based on above) to sampleserver6.arcgisonline.com for the printing service, but your proxy only allows access to

<serverUrl url="http://services.arcgisonline.com"
                   matchAll="true"/>
0 Kudos
ralphholmes
Occasional Contributor
So after Reading the Reedme again I have more questions...

The [yourmachine] part of proxyUrl... is this the external server location for the proxy file?
if so how can i determine what the external path is?

Currently <ProxyConfig allowedReferers> is set to "*" should I replace this with the web address for the html page?
Should I include any links that I have in my application in this section as well?

For the <serverUrls> should I include both the rest server for the print templates and the server for the html page?

Do both need to be matchall= "true"?

Again thank you for your help. I have never set up a proxy before...
0 Kudos