|
Rank: Member Groups: Member
Joined: 1/24/2008 Posts: 13
|
Hi, Thanks for reading my question. I'm using the progressbar on a mechanically automated lab station that interrogates hardware and changes its settings. Currently using EO Web Controls 2008. I've dropped a progress bar into my web app. When I click StartTaskButton in the web app, everything works fine (after a little fussing). Problem is, I want to use two different buttons to execute different portions of the sub. Each one should update the progress bar and send the extra data which is used to update my <span></span> sections. Can this be done?
Code: Visual Basic.NET
Private Sub ProgressBar1_RunTask(object, args) handles prog1.runtask
If Button A click then
Move.stage
Measure.tool
e.UpdateProgress(10, extradata)
else
Move.stage
Measure.tool
e.UpdateProgress(10, extradata)
Do.calcs
Move...etc
End If
End Sub
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
This can be done through a two stage process. The first stage would be a regular postback that pass whatever information you would like to pass to the server side. Once the information is on the server side, you may store it as a Session variable.
The first stage would then render some JavaScript (which can be done by setting a Label control's Text to some JavaScript code enclosed in <script> tags). That code would then use ProgressBar's client side JavaScript to start the progress bar.
The key is to separate the button from the ProgressBar.
Thanks
|
|
Rank: Member Groups: Member
Joined: 1/24/2008 Posts: 13
|
Hi,
I nearly understand. Each button is tied to its own Sub on the server side code to handle the button click. These two Subs are used to update a session variable then change a, and here's where I get lost, label which when the page loads, renders some javascript that calls the Progressbar's runtask?
I tried calling the runtask using javascript before and all the server side code executes but none of the client side GUI is updated. I just basically attached an onclientclick that executed a javascript function in the page header that called the runtask.
I am using ASP.NET ajax with update panels. This progress bar is inside of one of the update panels. I'm not sure if I can do a postback without losing some state information...I do need the features of the progressbar, so I may have to change the flow of the page to accomodate...but if I can avoid a page refresh, that would be good. I don't want to run the onload sub, as that clears some cookies.
Thanks for your help!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi, Please see if this post helps: http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=1366You will want to take UpdatePanel out first. Try to get the rest to work correctly first. Thanks
|
|
Rank: Member Groups: Member
Joined: 1/24/2008 Posts: 13
|
Hi, I just dropped the ProgressBar into an UpdatePanel using the following code:
Code: HTML/ASPX
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<eo:ProgressBar
ID="ProgressBar1"
runat="server" IndicatorColor="LightBlue" Value="0" ShowPercentage="True" ControlSkinID="None"
DesignOptions-ApplicationRoot="C:\websites\ACSvb" BorderColor="Black" BorderWidth="1px"
BorderStyle="Solid" Height="50px" ClientSideOnValueChanged="OnProgress" StartTaskButton="StartAcquire"
StopTaskButton="StopAcquire" Width="200px"
>
</eo:ProgressBar>
</asp:UpdatePanel>
This resulted in the following error: Parser Error Message: Type 'System.Web.UI.UpdatePanel' does not have a public property named 'ProgressBar'. Can the progressbar run in an updatepanel? Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi, You will want to consult other resource on this. The easiest way to verify if the issue is related to us is to replace our controls with some standard ASP.NET control and see if you run into the same problem --- in this case you will. We do not want to give you the false illusion that we support every questions as soon as our controls are involved. That is not the case. We expect you to verify whether the issue is related to our product before requesting support. You can take a look of our support policy here: http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=1368Thanks for understanding!
|
|
Rank: Member Groups: Member
Joined: 1/24/2008 Posts: 13
|
I posted my question before debugging. Turned out to be a simple issue. I forgot to enclose my progressbar in <ContentTemplate> tags. With that done, it renders and runs fine. I wasn't able to figure out the javascript trick so I just decided to use two progress bars, each tied to a different Sub with a bunch of redundant code but, it works.
Code: HTML/ASPX
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<eo:ProgressBar
ID="ProgressBar1"
runat="server" IndicatorColor="LightBlue" Value="0" ShowPercentage="True" ControlSkinID="None"
DesignOptions-ApplicationRoot="C:\websites\ACSvb" BorderColor="Black" BorderWidth="1px"
BorderStyle="Solid" Height="50px" ClientSideOnValueChanged="OnProgress" StartTaskButton="StartAcquire"
StopTaskButton="StopAcquire" Width="200px"
>
</eo:ProgressBar>
<eo:ProgressBar
ID="ProgressBar2"
runat="server" IndicatorColor="LightBlue" Value="0" ShowPercentage="True" ControlSkinID="None"
DesignOptions-ApplicationRoot="C:\websites\ACSvb" BorderColor="Black" BorderWidth="1px"
BorderStyle="Solid" Height="50px" ClientSideOnValueChanged="OnProgress" StartTaskButton="BalanceSubstrates_Button"
StopTaskButton="StopBalance_Button" Width="200px"
>
</eo:ProgressBar>
<span id="StartAcquireDiv" style="visibility: visible">
<asp:ImageButton ID="StartAcquire" runat="server" ImageUrl="~/images/Scan2.jpg" Width="100" />
</span>
<span id="StopAcquireDiv" style="visibility: hidden">
<asp:ImageButton ID="StopAcquire" runat="server" ImageUrl="~/images/cancel.jpg" Width="100" />
</span><br />
<span id="BalanceSubstrates_span" style="visibility: visible">
<asp:ImageButton ID="BalanceSubstrates_Button" runat="server" ImageUrl="~/images/Balance.jpg" Width="100" />
</span>
<span id="StopBalanceDiv" style="visibility: hidden">
<asp:ImageButton ID="StopBalance_Button" runat="server" ImageUrl="~/images/cancel.jpg" Width="100" OnClientClick="CancelScan();" />
</span><br />
<asp:Button ID="Button1" runat="server" OnClientClick="CancelScan();" Text="Refresh" />
</ContentTemplate>
</asp:UpdatePanel>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Excellent. Thank for understanding and for the update. As pointed out in our previous post, if you indeed want to get the JavaScript working, you want to get it working before putting in UpdatePanel. UpdatePanel naturally interferes with some JavaScript because JavaScript was invented before UpdatePanel. Once you get it working without UpdatePanel, you can then start putting in UpdatePanel and most of the time, it will work just fine. And if it doesn't work, then you can dig into UpdatePanel's source code and that might give you a workaround. As you might have guessed, we view the JavaScript part as generic web programming, so while our support won't mind to give you some pointers, we generally do not respond any JavaScript questions. So if you'd rather not to go there alone, then the two ProgressBar solutions might be an acceptable solution. If you do intend to get into the JavaScript part, you will want to take a look of this topic: http://www.essentialobjects.com/ViewDoc.aspx?t=clientapi_howto.htmlIt explains how to use JavaScript to call our control's client side JavaScript interface. Thanks
|
|
Rank: Member Groups: Member
Joined: 1/24/2008 Posts: 13
|
Thanks for being so quick to respond and willing to help. I will definitely recommend this tool when I have an opportunity and remember you guys in the future if our programming needs increase beyond this free tool.
|
|