Add a button in WAB that opens a webpage or URL?

3522
5
Jump to solution
06-16-2016 12:24 PM
JohnHarney
New Contributor III

Is there a way to add a button (similar to a widget button or icon) to WAB (Developer Edition) that will simply open a webpage or URL?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
5 Replies
LeoLadefian5
Occasional Contributor II

You could configure the about widget with a url inside of it?  That would be a workaround.

0 Kudos
TimDine
Occasional Contributor II

I wasn't able to get a button that sat in the widget bar to do what you're describing.  I wanted to open a help document from there rather than the links bar or the about page.  I built a widget that on it's open event opened a new window with the url I wanted, then the widget panel closed itself.  You can occasionally see it momentarily if you're watching for it, but it give the behaviour I was looking for.

onOpen: function() {

        window.open(this.config.hyperlink);

        var theWidgetID = this.id;

        require(["jimu/PanelManager"], function(PanelManager) {

            console.log(theWidgetID);

            var pm = PanelManager.getInstance();

            PanelManager.getInstance().closePanel(theWidgetID + "_panel");

        });

      }

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

All,

  I have created a widget for this now:

Url Button Widget Version 2.1 - 07/29/2016

JohnHarney
New Contributor III

Thanks Robert. That's exactly what we were looking for!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

John,


  Don't forget to mark this thread as answered by clicking on the "correct answer" link on the reply that answered your question.

0 Kudos