I have an embedded WAB Application using the enhanced search widget from #robert scheitlin in aspx and would like to perform an http redirect after a search or mouse click within the map using a value in the results pane to reload the aspx page. Any information would be appreciated. Thanks!
Solved! Go to Solution.
Martin,
In the eSearch widget.js file find the _drawResults function:
_drawResults: function (layerIndex, results, currentLayer, closeOnComplete) {
var layerConfig = this.config.layers[layerIndex];
if (this.graphicsLayerBuffer instanceof FeatureLayer) {
this._addOperationalLayer(this.graphicsLayerBuffer);
}
if (currentLayer instanceof FeatureLayer) {
this._addOperationalLayer(currentLayer);
}
var type, centerpoint;
for (var i = 0, len = this.currentFeatures.length; i < len; i++) {
var feature = this.currentFeatures[i];
//Do your stuff here as this would be the results from a search
var parcelId = feature.attributes["yourfieldname"];
//Now use parcelId in your redirect.
//I am not sure about the aspx part maybe something like
window.parent.location = "new url";
Martin,
In the eSearch widget.js file find the _drawResults function:
_drawResults: function (layerIndex, results, currentLayer, closeOnComplete) {
var layerConfig = this.config.layers[layerIndex];
if (this.graphicsLayerBuffer instanceof FeatureLayer) {
this._addOperationalLayer(this.graphicsLayerBuffer);
}
if (currentLayer instanceof FeatureLayer) {
this._addOperationalLayer(currentLayer);
}
var type, centerpoint;
for (var i = 0, len = this.currentFeatures.length; i < len; i++) {
var feature = this.currentFeatures[i];
//Do your stuff here as this would be the results from a search
var parcelId = feature.attributes["yourfieldname"];
//Now use parcelId in your redirect.
//I am not sure about the aspx part maybe something like
window.parent.location = "new url";
That did it thanks Robert!!!