AnsweredAssumed Answered

Can't add Dialog to a Web AppBuilder widget.js file

Question asked by David.Wendelken on Jun 13, 2017
Latest reply on Jun 14, 2017 by igras705

Ok, I'm embarrassed.   From the documentation this should be really easy, but I'm clearly missing something.

 

I'm trying to add a dialog to a widget.   In the widget.js file, I've added a button that, when pressed, is supposed to create the dialog.

 

I've added the relevant references to the define and function at the top of the widget.

 

Here's the code to create the dialog:

 

var dialog = new Dialog({
    title: 'dialog title',
    id: 'myDialogId',
    content: 'dialog content'
});
dialog.placeAt(win.body());
dialog.startup();
dialog.show();

I've tried gobs of variations and it doesn't work.

 

I get what appears to be a box-shadowed tooltip that says "dialog title".  
I get a loading gif in the middle of the page. 
And the app becomes unresponsive!

 

Here is the html code that gets added to the page:

 

<div title="dialog title" class="jimu-loading-shelter" id="myDialogId" widgetId="myDialogId">
    <div class="img-div" data-dojo-attach-point="imgDiv">
        <img src="/webappbuilder/apps/2/jimu.js/images/loading2.gif" data-dojo-attach-point="loadingImg"></img>
    </div>
    <p data-dojo-attach-point="textNode"></p>
</div>


No errors or warnings show up in the debugger console.  No network calls.  (The loading2.gif is already cached.)

Any idea what I'm doing wrong?

Outcomes