Rank: Newbie Groups: Member
Joined: 9/2/2008 Posts: 2
|
Hi Essential Objects Inc., we are using the "EO ProgressBar" and have a problem which is blocking for us. We have a WebForm (using ASP .NET 3.5 [C#]) in which we have the "EO ProgressBar" and three buttons (Start, Stop, Cancel). We have assigned the StartTaskButton & StopTaskButton properties to the corresponding buttons id (respectively Start and Stop). We need to hide the Cancel button (whose function is to close our popup) while the Start is clicked: we have made it with javascript. We need to show the Cancel button when the Stop button is pressed, but we cannot achieve/manage this funcionality since the execution does not pass through our javascript function. We have also tried to do that with the PBImport_StopTask method with this declaration in our code-behind: EO.Web.ProgressBar.RegisterTaskNotify(null, null, PBImport_StopTask); protected void PBImport_StopTask(object sender, EO.Web.ProgressTaskEventArgs e) { BTCancel.Visible = true; } But it does not work although the execution passes through PBImport_StopTask (the BTCancel button remains *not* visible - that was the state we set after pressing Start). How can we solve the problem? Thank You very much in advance. Best Regards. Sergio
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi, All ProgressBar event, including RunTask, can not be used to change anything in the page except for the ProgressBar itself. the comment in this sample (switch to C# tab) explained this in great detail: http://www.essentialobjects.com/Demo/Default.aspx?path=ProgressBar\_i2So in order to update anything other than the progress bar itself, you must rely on JavaScript. For example, you can take the following steps to hide the cancel button once it is clicked:
Code: HTML/ASPX
<input type="button"
id="BTCancel" value="Stop!" onclick="stopProgressBar()" />
Code: JavaScript
function stopProgressBar()
{
//hide the button
document.getElementById("BTCancel").style.display = "none";
//stop the progress bar
eo_GetObject("PBImport").stopTask();
}
Point of interests: 1. BTCancel is a client side DHTML button here, not a server button; 2. StopTaskButton is not set for the ProgressBar; 3. The ProgressBar is stopped by calling its client side JavaScript interface. More details can be found here: http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.ProgressBar.htmlHope this helps. Thanks!
|
Rank: Newbie Groups: Member
Joined: 9/2/2008 Posts: 2
|
Thank You very much, Your suggestion works fine! Best Regards, Sergio
|