Select to view content in your preferred language

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

3847
5
Jump to solution
06-16-2016 12:24 PM
JohnHarney
Occasional Contributor

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
Frequent Contributor

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

0 Kudos
TimDine
Frequent Contributor

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
Occasional Contributor

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