What I'm trying to do is zoom to the selected feature and then send the map to the printer. Then zoom to the buffer and again print the resulting map to the printer. Each of the following steps works by themselves. However, I'm having a problem figuring out how to sequence the statements and use timeouts to ensure that each step is completed before the next process starts? Here's my code:
//Zoom to Parcel
setTimeout(lang.hitch(this, function () {
this.zoomselected();
}), 3000);
setTimeout(lang.hitch(this, function () {
html.setStyle(this.PrintMessage, 'display', 'block');
}), 5000);
//Zoom to Buffer
setTimeout(lang.hitch(this, function () {
this.zoombuffer();
}), 3000);
setTimeout(lang.hitch(this, function () {
html.setStyle(this.PrintMessage, 'display', 'block');
this.sendToPrinter_SoilErosion(sTitle,sLayout,sFormat,sMessage);
}), 5000);