Add help button link inside widgets

2663
25
05-04-2017 02:58 PM
CCWeedcontrol
Occasional Contributor III

Not sure how complicated it is but i would like to add a 'Help' button onto some of the widgets i have on my application. I tried coping the 'Measure' widget code but i can't get to work. I would gratefully appreciate any help please.

I have added the help image to html with the following and can see the help icon inside the widget.

div data-dojo-type="jimu/dijit/LoadingShelter" data-dojo-attach-point="shelter" data-dojo-props="hidden:true"></div>
  <br><br><br><br><br><br><br><br><br><br><br><br>
    <img src="widgets/ElevationProfile/images/help.png" height="25" width="62" data-dojo-attach-point="helpImage" style="cursor:pointer" />
</div>

I added the function in the _blindEvents: Function like so.

_bindEvents: function () {
        this.own(on(this.btnClear, 'click', lang.hitch(this, this._clear)));
        html.setStyle(this.btnClear, 'display', 'none');
        this.own(on(this.btnExport, 'click', lang.hitch(this, this._export)));
        this.own(on(this.helpImage, 'click', lang.hitch(this, function() {
            var win = window.open("widgets/ElevationProfile/help/index.html", "_blank");
  win.focus();
        })));
        html.setStyle(this.btnExport, 'display', 'none');
        html.setStyle(this.btnInfo, 'display', 'none');
        html.setStyle(this.btnDownload, 'display', 'none');
      },
0 Kudos
25 Replies
RobertScheitlin__GISP
MVP Emeritus

Just,

this._bindEvents();

0 Kudos
CCWeedcontrol
Occasional Contributor III

my apologies for my slowness, but i do have this._bindEvents(): in the widget.js. See attached.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

alright this is to much back and forth with bits and pieces. Can you attach your whole widget,

0 Kudos
CCWeedcontrol
Occasional Contributor III

I have attached the widget. Thanks.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

When I added your widget to an app it had the help button and the mouse changed and the help doc showed when clicked.

0 Kudos
CCWeedcontrol
Occasional Contributor III

WHAT! Did you add to Dev Web Appbuilder folder or the deployed app? i am working with ta deployed application.

0 Kudos
CCWeedcontrol
Occasional Contributor III

Robert i see the problem i was testing in Chrome, once i opened the application on Firefox i was able click on the help button. So is the issue with Chrome?

Also does not work on internet explorer.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Nope I primarily work in Chrome and it worked fine for me.

0 Kudos
CCWeedcontrol
Occasional Contributor III

interesting. i am on Version 57.0.2987.133 on Chrome.

Also does not work on internet explorer for me.

Any idea on why i am having these issues with these browsers.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

try using a new incognito window in chrome and paste your apps url in the addressbar to verify if it is a cache issue.

0 Kudos