Tooltip not coming for Draw point tool

1193
1
08-24-2016 11:02 PM
ShaikhRizuan
New Contributor III

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

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Shaikh,

   It sounds like you have not changed enough code and css rules to make your widget distinct from the Identify widget. That is why the identify widget css rule is affecting your widget. Also you may want to check your manifest.json and the Widget.html to see if your widget is still pointing to "widgets/Identify/abc".

As far as the tooltip portion of your question. I do not completely follow your issue but if you look at other widgets that change the esriBundle for the draw you will see that the original tooltip text is saved to a var in the widget so that it can be restored when your widget closes (don't just set it to "").