Splash screen using Infragistics – WebDialogWindow control

Hello,

Recently I’ve been asked by customer how to use WebDialogWindow "Please wait message " notification. I’ve put together a small sample showing one possible implementation of such scenario. In this particular case the customer was using UpdatePanel and I had to subscribe to the UpdatePanlel request’s in order to be notified when the request begins and ends.
How the aspx page looks like:

    <asp:UpdatePanel runat="server" ID="UpdatePanel1">

    <ContentTemplate>

        <ig:WebDialogWindow ID="WebDialogWindow1"

        runat="server" Width="200px" Height="100px" Modal="true" Visible="true"

        WindowState="Hidden" InitialLocation="Centered">

            <Header CaptionText="Caption">

            </Header>

            <ContentPane>

            <Template>

                <asp:Label ID="Label1" Text="Please wait …." runat="server" />

            </Template>

            </ContentPane>

        </ig:WebDialogWindow>  

        <asp:CheckBox ID="CheckBox1" runat="server" />

        <asp:Button ID="Button1" runat="server" Text="Save" OnClick="Button1_Click" />

    </ContentTemplate>

</asp:UpdatePanel>

The interesting part comes here:

    <script type="text/javascript">

 

    //Add handlers to Begin and End requests raised by UpdatePanel

    var prm = Sys.WebForms.PageRequestManager.getInstance();

    prm.add_beginRequest(showWebdialogWindow);

    prm.add_endRequest(hideWebDialogWindow);

 

    function showWebdialogWindow() {

        var wdw =

        $find(‘<%=WebDialogWindow1.ClientID %>’);

        wdw.set_windowState($IG.DialogWindowState.Normal);

    }

 

    function hideWebDialogWindow() {

        var wdw =

        $find(‘<%=WebDialogWindow1.ClientID %>’);

        wdw.set_windowState($IG.DialogWindowState.Hidden);

    }          

</script>

So,  this is easy job 🙂
First I’m getting a reference to PageRequestManger object which allows me to subscribe handlers to page life cycle and then when request is being initiated by the control inside of UpdatePanel the function  showWebDialogWindow() is executed. When the request complete hideWebDialogWindow() function is raised and I’m hiding the WebDialogWindow
Regards,
Rado

Advertisements

7 thoughts on “Splash screen using Infragistics – WebDialogWindow control

  1. Hi Rado,

    I am facing a browser compatibity issue with my website. It is working fine on IE 6,7 and 8 on development machine. But on client machine which is having IE 8 the WebDialogWindow throws javascript error and it never loads.
    Only on turning on the “Compatibility view” it started working on client’s machine as well.

    Can you please suggest any solution to fix this without asking the users to switch to compatibility view?

    Thanks in advance.

    • Hi Aksimet,

      Thanks for your question. I would suggest a few approaches to get rid of this issue.
      First of all if you experience any errors with the control the recommended way would be to contract the support team. As far as I know IE8 is fully supported environment for WebDialogWindow and if your version is old one the best resolution would be upgrade to latest service release for the version or upgrade to newer one.

      If you prefer some kind of work around something that come up on top of my head is to use metatag to instruct the browser to emulate the IE7, more info, please have a look at this link :http://ilia.ws/archives/196-IE8-X-UA-Compatible-Rant.html
      For the second approach aren’t needed user effort.
      Hope this helps!

  2. Hello,

    Meta tags didn’t work for me, I am dealing with “NetAdvantage ASPNET 20083 CLR35” version “8.3.20083.1009”. I am going to contact the support team regarding this.

    Thank you very much for your help.

  3. Hi Rado, Thanks for nice post.

    How to set WebDialogWindow.WindowState to Normal from code behind only without any user event? For example, I executed one stored procedure and if result was -1, then I need to run another long lasting process such as Oracle package and in this case I need to set WebDialogWindow.WindowState to Normal. In all other cases I do not want to show WebDialogWindow.

    • Hello Dmmitry,

      You can change the state of the control in this way:

      protected void Page_Load(object sender, EventArgs e)
          {
              this.WebDialogWindow1.WindowState =
                      Infragistics.Web.UI.LayoutControls.DialogWindowState.Hidden;//Normal
          }
      

      The code above will work only on postback but as you said if you need to wait a long lasting procedure and use an UpdatePanel in the equation make sure that the WDW is defined inside the updatePanel control. Implemented in this way it’s a kind of blocking operation , you may choose to go differently with async methods on the server and some javascript code that returns to the client as soon as the server operation completes and you set via javascript the state of the control.

      Hope this helps a bit
      Best, Rado

      • Thanks Rado very much.
        First of all your code is great and I used it already as is to patch our imediate needs. Regarding Page_load and everything else: I sure tried it in this way and it sure did not work straight forward in production, probably because of complexity our asp page. But you just confirmed that it should work and it gives me good point to spend part of my weekend to make it working in any 🙂

        Thanks again and happy coding.
        Dmitriy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s