|
Rank: Newbie Groups: Member
Joined: 8/18/2008 Posts: 9
|
I put my ProgressBar inside a div and gave it style="visibility:hidden".
Code: HTML/ASPX
<div title="UploadProgressBarDiv" id="UploadProgressBarDiv" style="visibility:hidden" >
<eo:ProgressBar ID="UploadProgressBar1" runat="server"
BackgroundImage="00060101" BackgroundImageLeft="00060102"
BackgroundImageRight="00060103" ControlSkinID="None" IndicatorImage="00060104"
IndicatorIncrement="7" onruntask="UploadProgressBar1_RunTask"
ClientSideOnValueChanged="OnProgress"
ShowPercentage="True" StartTaskButton="PDFUploadButton" StopTaskButton="CancelButton" Value="30"
Width="250px" />
<br />
</div>
As you see, PDFUploadButton is the button that starts the action, and OnProgress is called everytime anything changes. My idea was to make the div visible in OnProgress.
Code: JavaScript
// OnProgress is called whenever the progress bar is updated.
function OnProgress(progressBar)
{
var progressBarDiv = $get("UploadProgressBarDiv");
progressBarDiv.style.visibility='visible';
var extraData = progressBar.getExtraData();
if (extraData)
{
if (extraData.substring(extraData.length - 1) == "%")
{
// Still busy.
}
else if (extraData.substring(0,5) == "Done.")
{
$get("ErrorMsgLabel").innerText = "";
var filename = extraData.substring(6);
$get("PdfFileNameHdn").value = filename;
setTimeout( 'doSwitchView();' , 2000);
}
else
{ // An error occurred. Strip off the prefix "Error. "
$get("ErrorMsgLabel").innerText = extraData.substring(7);
}
}
}
However, the ProgressBar is NEVER invisible. How can I make it visible/invisible? When and where should I add the hooks to do so? - Paul
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
Have you tried "display:none" instead of "visibility:hidden"?
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 8/18/2008 Posts: 9
|
I tried your suggestion. Now the control starts out hidden, but when I attempt to show it, it won't show! (Otherwise all the logic works fine.) This is how I try to show the control:
Code: JavaScript
var progressBarDiv = $get("UploadProgressBarDiv");
progressBarDiv.style.display='block';
Any ideas? - Paul
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
This might be a dumb question: Do you still have "visibility:hidden" on your div? You can also try two things:
1. Put some other static HTML text inside UploadProgressBarDiv and see if that shows up. If that still does work, then 2. Move the ProgressBar outside of UploadProgressBarDiv and see if situation changes;
If the problem persists, please create a test page that demonstrates the problem and we will be happy to take a look. Make sure the page runs independently.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 8/18/2008 Posts: 9
|
Hi,
No, I removed the visibility:hidden.
1. I tried adding plain text inside the div tag as you suggested, but it never displays. 2. When I move the ProgressBar outside the div, it starts visible and stays visible. The text remaining inside the div never shows.
When I have the time I will attempt to reduce this to a simple case for you to explore.
- Paul
|
|
Rank: Newbie Groups: Member
Joined: 8/18/2008 Posts: 9
|
Further experimentation allowed me to start the ProgressBar inside a div with display=none, then make it visible using this code inside my OnProgress javascript function:
Code: JavaScript
var progressBarDiv = $get("UploadProgressBarDiv");
progressBarDiv.style.display='block';
This code at first did not work. I think it was because my button for starting the process had an onclick method still, left over from before I added the EO control which now steals the onclick frmo the button. THe server-side function is never called, but it may have interfered. Thanks for your help. - Paul
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
That is correct: StartButton and StopButton are taken over by the progress bar and they will never fire their server side event.
Thanks
|
|