AnsweredAssumed Answered

Tooltip not coming for Draw point tool

Question asked by shaikhrizuan on Aug 24, 2016
Latest reply on Aug 25, 2016 by rscheitlin

Hi, 

i created a new widget in WAB, Which is more or less similar to Identify widget. By default point tool is active for the new widget as Identify widget but the background selection color is not same as Identify widget. PFB image for the same.

New widget after initializing

I have changed the Name of the files and base class name in widget.js for new widget. Also i have changed the tool-tip for  cursor using the below code in _initInflowDrawBox method in js file. 

esriBundle.toolbars.draw.addPoint = "Click to identify a layer";

While opening first time after application loaded, I am  getting the tool-tip. But when i toggled with any other widget it is showing blank tool-tip. I set the empty string in "onMinimize" tab and adding the value on "onMaximize" tab for tool-tip. After click on the map, i am getting the tool-tip.

_addThemeFixes: function () {
/*Workaround for the LanunchPad theme not firing onClose and onOpen for the widget*/
if(this.appConfig.theme.name === "LaunchpadTheme"){
var tPanel = this.getPanel();
if(tPanel){
aspect.after(tPanel, "onClose", lang.hitch(this, this.onClose));
aspect.after(tPanel, "onOpen", lang.hitch(this, this.onOpen));
}
}
/*end work around for LaunchPad*/
/*Workaround for TabTheme moregroup not calling onClose and onOpen when the SidebarController is minimized*/
if(this.appConfig.theme.name === "TabTheme"){
var sidebarWidget = this.wManager.getWidgetsByName('SidebarController');
if (sidebarWidget[0]) {
aspect.after(sidebarWidget[0], "onMinimize", lang.hitch(this, this.onClose));
aspect.after(sidebarWidget[0], "onMaximize", lang.hitch(this, this.onOpen));
}}}

onOpen: function () {
if(this.graphicsLayer){
this.graphicsLayer.clear();
if(this.autoactivatedtool){
this.drawBox.activate(this.autoactivatedtool.toUpperCase());
}
}
esriBundle.toolbars.draw.addPoint = "Click to identify a layer";
},

onClose: function () {
this._hideInfoWindow();
this.drawBox.deactivate();
this.graphicsLayer.clear();
esriBundle.toolbars.draw.addPoint ="";
this.infoWinMouseOver.remove();
this.infoWinMouseOut.remove();
},

PFB image for the same:

The same issue is happening with identify widget also where i am adding the tooltip on "onMaximize" tab and empty string in "onMinimize" tab event  . Also when i toggled the new widget with Identify widget, the background color got changed( please see the above image).when debugging the code, While opening the identify widget, the "onOpen" method runs in 2 plcaes, First it execute in widget.js of identify widget and then it went to widget.js of new widget.  PFB image for identify widget.

 

I am attaching the widget.js file for new widget. please let me know if any change is required.

Thanks,

Shaikh

Attachments

Outcomes