Unable to fire Event Handler when using Message Class.

235
5
12-12-2017 11:26 PM
VenkataSrikanth_Dasari
Occasional Contributor

Hi,

I am opening a new child window and creating a list of opened windows in the custom widget and gave an option to close the child window. Here is an example template of custom widget.

Child window is a pure html and JS code... result.html

Custom widget          x

List of Windows:

Window1       x

Window2       x

Window3       x         

Here the issue is with the Message class.... if i got any exception in the asynchronous process somewhere in the code ... I am using the Message to show the error message and at the same time opening the child window...

In the widget.js file, when I am closing the child window, child close event handler will remove the one item from the list.

Because of the error message showing using Message class, Close Event handler of the child window is not firing in the widget.js file.

Help required asap.

Cheers,

Srikanth Dasari

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Srikanth,

  Maybe your workflow needs to be adjusted then.

I am using the Message to show the error message and at the same time opening the child window...

How about not opening the child window until the OK event on the message dijit is clicked.

          var qMessage = new Message({
            type: 'question',
            titleLabel: "Blah blah",
            message: "Something went wrong",
            buttons: [{
              label: "Acknowledge",
              onClick: lang.hitch(this, lang.hitch(this, function () {
                qMessage.close();
                //Now open the child window
              }))
            }]
          });
KenBuja
MVP Honored Contributor

Nice reply, Robert Scheitlin, GISP

How did you find out about the ability to add buttons to a Message? The lack of documentation about so much of the WAB drives me bonkers.

Edit...Now I see it also. I had to open not only the Message.js file to discover its inputs, but also the Popup.js that it uses.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Ken,

  I just open the files and look in the code rather then worry about documentation.

0 Kudos
KenBuja
MVP Honored Contributor

I've also been digging through the existing widgets to attempt to figure out how to implement something, but the modules that they use also require quite a bit of digging to see what other capabilities they have.

RobertScheitlin__GISP
MVP Esteemed Contributor

Ken,

   If you have any specific question I might be able to help with just post.

0 Kudos