Closing AlertBox

Answered
0
0

Dear Team,

 

I wonder if it is possible to get back the handle of the AlertBox control as a result of the AlertBox.Show() call.

This will allow closing the AlertBoxes programmatically, e.g when autoCloseDelay=0 or before the delay expiration.

 

Current alternatives:

  1. Enumerate the windows and find my AlertBox
  2. Implement my own custom AlertBox.

 

Kindest Regards.

Kizaemon

  • You must to post comments
Best Answer
1
0

AlertBox and MessageBox don’t exist on the server. When you call the static Show() method the widget is sent to the client and immediately disposed. If you use the close callback to get notified when the AlertBox is closed, and only in that case, Wisej registers a “proxy” component that will receive the “close” event and then gets disposed. Basically the AlertBox is simply a less intrusive alternative to the MessageBox.

You can use the new Wisej.Web.Toast component instead. It lets you create a reference, reuse it and even update it live while it is shown.

var toast = new Toast("Test");
toast.Show();
toast.Close(); // this doesn't dispose it, you can reuse it and call Show() again. When done use Dispose().

 

In the theme it uses the “toast” appearance.

HTH

 

  • Kizaemon
    Thank you! Toast is what I need. Also thank you for the insightful explanation on how AlertBox is working. Now I understand the usage case.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.