Welcome Guest Search | Active Topics | Sign In | Register

Close a Dialog box Options
MRaymond
Posted: Monday, September 7, 2009 9:13:30 PM
Rank: Newbie
Groups: Member

Joined: 7/15/2009
Posts: 8
Hello,

I used your Server side Task-Advanced 2 example to program my progress bar. I placed the progress bar in a dialog box. When the progress bar finishes, I want it to close the dialog box immediatly. And without using a button or any others user's intervention to close.
Can you tell me how to do this ??

Thank you for your help!

Martin Raymond





eo_support
Posted: Monday, September 7, 2009 9:23:43 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

If you are also using a CallbackPanel like the sample does, then all you need to do is to place your dialog inside the CallbackPanel. Otherwise you will need to change function OnProgress to something like this:

Code: JavaScript
function OnProgress(progressBar)
{
    var extraData = progressBar.getExtraData();
    if (extraData)
    {
        .....

        //Close the dialog when the task is done
        if (extraData == "The task is done!")
           eo_GetObject("Dialog1").close();
    }
}


Note you can pass any value to the client to indicate the progress bar is done, as long as your client side code knows what your server side code is passing. For example, the demo page passes "The task is done!" from the server and the client side code checks for this value.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.