Welcome Guest Search | Active Topics | Sign In | Register

How to fired Progress Bar event after an Toolbar item is clicked Options
chyong
Posted: Monday, July 14, 2008 8:49:00 PM
Rank: Newbie
Groups: Member

Joined: 7/14/2008
Posts: 1
Hi, I would like to use essential objects toolbar and progress bar in my web application. Once user click on the toolbar item, let's said is 'Save' button, the progress bar should showing the saving data progrss. I have try to set ProgressBar.StartTaskButton = ToolBarControlID. But, this make the system not fired my toolBar_ItemClick event. This is not correct, because there has other item option in my toolbar, like 'New', 'Close'. So, my question is how to start the progress task after user click the 'Save' item in my toolbar?

Thanks,
Chyong
eo_support
Posted: Monday, July 14, 2008 9:03:12 PM
Rank: Administration
Groups: Administration

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

StartButton must be a button. So that will not work for you. You will need to use JavaScript to start the progress bar:

Code: JavaScript
function start_progress_bar()
{
    eo_GetObject("ProgressBar1").startTask();
}


However how to call this function depends on whether your ToolBar triggers server event. If your toolbar triggers server event (when AutoPostBack is set to true), you can use the following solution:

1. Place an asp:Label into your page after the ProgressBar;
2. Handle the ToolBar's ItemClick. Inside this event handler you would set the Label's Text to

"<script type='text/javascript'>start_progress_bar()</script>";

This way when the Label is rendered, start_progress_bar get called.

If the toolbar's AutoPostBack is set to false, you will want to handle the toolbar's ClientSideOnItemClick event:

Code: HTML/ASPX
<eo:ToolBar ClientSideOnItemClick="toolbar_click_handler" .....>
.....
</eo:ToolBar>


Code: JavaScript
function toolbar_click_handler(toolbar, toolbarItem, subMenu)
{
    if (toolbarItem.getCommandName() == "Save")
        start_progress_bar();
}


You can find detailed information about client side JavaScript objects at here:

http://www.essentialobjects.com/ViewDoc.aspx?t=clientapi_howto.html

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.