Create off-panel widget to display information automatically after splash screen

4401
22
Jump to solution
06-17-2016 10:45 AM
WilliamMiller4
Occasional Contributor II

I would like to show additional information after the user agrees to the terms & conditions on the splash screen. What ESRI or DOJO class (a dijit/Dialog perhaps?) should I use to display this information as an off-panel widget and how would I have it display automatically upon the close of the splash screen? Any help is much appreciated.

0 Kudos
1 Solution

Accepted Solutions
SteveCole
Frequent Contributor

I'm not using WebApp Builder but here's how I've accomplished something that I think looks similar. I have a separate JS file that constructs the dialog (see attached code) and the dialog is created/displayed on a button click that triggers the showHelp() function inside the JS file. I've also attached a screenshot of the dialog.

The code isn't pasting very well into the post (Thanks, GeoNet!) so I'm attaching it as a file.

mapHelpExample.jpg

View solution in original post

22 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

William,

  I would use jimu/dijits/Message.js for that.

0 Kudos
WilliamMiller4
Occasional Contributor II

Hi Robert,

Would I include this in the define section of my widget? Is there any more documentation on this other than what is in the Message.js file itself? Also, can an off-panel widget be added to the headerController, and if not, where?

Thanks,

William

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

William,

  Based on your scenario I would just add this to the splash widgets Widget.js in the define and not worry at all with adding a new widget. No there is no documentation on the Message dijit other then what you can derive from the code in the Message.js

0 Kudos
WilliamMiller4
Occasional Contributor II

Robert,

I added 'jimu/dijit/Message' to the splash widget's define and Message to the argument list. Where/How do I override the empty message string in Message.js?

William

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

William,

  To use the Message dijit is is as simple as:

new Message({
    titleLabel: "Some Title,
    message: "Some message"
});

or as advanced as:

          var qMessage = new Message({
              type: 'question',
              titleLabel: this.nls.warning,
              message: this.nls.graphicgeomtypemsg1 + "\n\n" + this.nls.graphicgeomtypemsg2,
              buttons: [{
                label: this.nls._continue,
                onClick: lang.hitch(this, lang.hitch(this, function () {
                  qMessage.close();
                  this.lastDrawCommonType = commontype;
                  this.lastDrawTool = geotype;
                  this.drawBox.clear();
                  this.garr = [];
                }))
              }, {
                label: this.nls.cancel,
                onClick: lang.hitch(this, lang.hitch(this, function () {
                  qMessage.close();
                  this.drawBox.activate(this.lastDrawTool);
                }))
              }]
            });
WilliamMiller4
Occasional Contributor II

Robert,

Would I add one of these to the onOkClick function in the splash widget?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

yep

0 Kudos
WilliamMiller4
Occasional Contributor II

Hi Robert,

Thank you for your suggestion, but I should have been more specific in my original question. The reason I was thinking of making a widget was because I wanted users to be able to reference the information presented after the splash screen at any point in the application. I don't want the widget to be in a panel, as I would like it to be centered on the screen. I also wanted to include tabs to help organize the data. I'm hoping to include this widget in the headerController. Any thoughts on what ESRI/DOJO class I should use for this widget? Thanks again for your attention to this matter.

William

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

WIlliam,

  There is no pre-made dijit that meets your needs then. When working with out of panel widgets almost all of the UI development is on you as the developer.

0 Kudos