Girish,
Hmmm...I select 2 parcels and push the statements to the promises array.
The alert on the promises length is 2. When the "all(promises).then" it just executes the statements (zoom to parcel, print, zoom to buffer, print) for the second selected parcel. It's doing everything correctly except chaining the two promises together. Any ideas? Am I missing something?
//Push the statements to promises
var promises = [];
var features = this.selValueShapeFeatures;
for (var i = 0; i < numSelected; i++) {
this.gFeature = features;
alert(features.attributes["PIN"]);
promises.push(this.zoomToFeature(this.gFeature)
.then(lang.hitch(this, this.sendToPrinter_SoilErosion))
.then(lang.hitch(this, this.zoombuffer))
.then(lang.hitch(this, this.sendToPrinter_SoilErosion))
);
}
//Number of records in promises
alert(promises.length);
//Execute promises
all(promises).then(function(results){
console.log("all features
printed");
});
Thanks.
Tom