AnsweredAssumed Answered

How to set titleText 'onPrintStart'?

Question asked by GilvarryCW on Mar 4, 2013
Latest reply on May 28, 2013 by LuciH
I'm trying to make it so that the user can set their own custom map title when they "print" the current view in the webmap application. However, I'm having trouble getting this to work.

    var template = [{                 label : "Portrait",                 format : "PDF",                 layout : "A4 Portrait",                 exportOptions : {                   width : 200,                   height : 200,                   dpi : 300                 },                 layoutOptions : {                   titleText : mapTitle,                   authorText : " ",                   copyrightText : "Coldwell Banker Commercial",                   scalebarUnit : "Miles",                 },               }, {                 label : "Landscape",                 format : "PDF",                 layout : "A4 Landscape",                 exportOptions : {                   width : 200,                   height : 200,                   dpi : 300                 },                 layoutOptions : {                   titleText : mapTitle,                   authorText : " ",                   copyrightText : "Coldwell Banker Commercial",                   scalebarUnit : "Miles",                 }               }];                           // print dijit               app.printer = new esri.dijit.Print({                 map : app.map,                 templates : template,                 url : "http://2501s-jjohnson:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"               }, dojo.byId("btn"));               app.printer.startup();                   dojo.connect(app.printer, 'onPrintStart', function() {                 mapTitle = prompt("What would you like to title this map?");               });


I'm trying to set the titleText using the mapTitle variable, which the user sets when they click the print button using the dojo.connect 'onPrintStart' event, but this isn't working. i'm pretty sure the titleText is already set in stone by the time the user is prompted to name the map, but i'm not exactly sure what I should be doing so that the template gets the user input from the mapTitle variable. Any guidance would be greatly appreciated!

Outcomes