Hello,
Everytime my WAB site loads it starts in an active edit session. What I mean by that is if I were to select anything on the map it opens an attribute editor window. I would like to have it start up in a non edit mode by default. So that when I select an item on the map it opens the info window instead of an edit window. How do I go about making that happen?
Greg
Solved! Go to Solution.
Greg,
Sure the reason why the normal popup works after clicking the home button is that the widget deactivates and the onDeActivate method is called. so you can just make a call to the onDeActivate method after the widget is opened (line 20).
onOpen: function() {
this._init();
LayerInfos.getInstance(this.map, this.map.itemInfo)
.then(lang.hitch(this, function(operLayerInfos) {
this._jimuLayerInfos = operLayerInfos;
var timeoutValue;
if(this.appConfig.theme.name === "BoxTheme") {
timeoutValue = 1050;
this.loading.show();
} else {
timeoutValue = 1;
}
setTimeout(lang.hitch(this, function() {
if(!this.loading.hidden) {
this.loading.hide();
}
this.widgetManager.activateWidget(this);
this._createEditor();
this.onDeActive();
}), timeoutValue);
}));
},
Greg,
The only way I know that the app would start in editing mode is if you have the edit widget set to open at start. If you do not have it set to open at start then you should not have an issue.
Jewelry Box Theme, WAB 2.2
I do not see any options for setting the edit state on open to edit or not edit.
Nope, Not really what I meant. If you have the edit widget set in the Jewelry Box themes drawer then it is opened at startup and thus the edit widget is activated and you are automatically in editing mode. If the edit widget is not in the Jewelry Box drawer and not set to open at start ("Open this widget automatically when the app starts"), then you will not have the issue.
Yes, the edit widget is included and is present when the site opens. Is there a way to change the edit state when the site opens? I noticed clicking on HOME widget stops editing and allows me to open the info widget correctly. It's just a pain to always have to stop the edit session by clicking home when the site loads.
Greg,
Sure the reason why the normal popup works after clicking the home button is that the widget deactivates and the onDeActivate method is called. so you can just make a call to the onDeActivate method after the widget is opened (line 20).
onOpen: function() {
this._init();
LayerInfos.getInstance(this.map, this.map.itemInfo)
.then(lang.hitch(this, function(operLayerInfos) {
this._jimuLayerInfos = operLayerInfos;
var timeoutValue;
if(this.appConfig.theme.name === "BoxTheme") {
timeoutValue = 1050;
this.loading.show();
} else {
timeoutValue = 1;
}
setTimeout(lang.hitch(this, function() {
if(!this.loading.hidden) {
this.loading.hide();
}
this.widgetManager.activateWidget(this);
this._createEditor();
this.onDeActive();
}), timeoutValue);
}));
},
Robert,
Thank You that worked.
Greg