Welcome Guest Search | Active Topics | Sign In | Register

ProgressBar inside Dialog Options
CJLopez
Posted: Friday, July 29, 2011 4:28:09 PM
Rank: Newbie
Groups: Member

Joined: 7/29/2011
Posts: 4
The thing is, my OnRunTask is not running. I have a button display the dialog and run the task, but its only displaying the dialog, it nevers runs the task here's the code of bout controls and the button

Code: HTML/ASPX
<asp:Button ID="btnImportar" runat="server" Text="Importar Lecturas" 
                Enabled="False"  UseSubmitBehavior="false" OnClientClick="clickOnce(this, 'Procesando...')" />
<eo:Dialog ID="Dialog1" runat="server" BackColor="White" Height="200px" Width="200px" HeaderHtml ="Exportación en Proceso" BorderStyle ="Solid"
            BorderColor="OrangeRed" BackShadeColor="Orange" ShadowDepth="3" AcceptButton="btnOk" ShowButton="btnImportar">
	        <HeaderStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 11px; padding-bottom: 3px; padding-top: 3px; font-family: tahoma"></HeaderStyleActive>
	        <ContentStyleActive CssText="border-top: #335c88 1px solid; background-color: #e5f1fd"></ContentStyleActive>
            <ContentTemplate>
                <eo:ProgressBar ID="ProgressBar1" runat="server" ShowPercentage="True" IndicatorImage="00060104"
	            BackgroundImageRight="00060103" ControlSkinID="None" BackgroundImage="00060101" IndicatorIncrement="7"
	            BackgroundImageLeft="00060102" Width="150px" StartTaskButton="btnImportar" OnRunTask="ProgressBar1_RunTask">
                    </eo:ProgressBar><br />                
            </ContentTemplate>
            <FooterStyleActive CssText="border-top: #335c88 1px solid; background-color: #e5f1fd" />
            <FooterTemplate>
                <div style="text-align:center">
                    <asp:Button ID="btnOk" runat="server" Text="OK" 
                        Enabled="False"  UseSubmitBehavior="false"/>
                </div>
            </FooterTemplate>
        </eo:Dialog>


Withouth the dialog, the runtask works perfectly, with it.... not so much
eo_support
Posted: Friday, July 29, 2011 4:59:44 PM
Rank: Administration
Groups: Administration

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

This is normal. You have both the dialog's ShowButton and the ProgressBar's StartTaskButton set to "btnImportar". You can use one. If you need to do both, you can handle the button's onclick event with Javascript and then trigger both inside your JavaScript event handler with our client side script interface.

If you have not used our client side script interface before, you will want to take a look this topic first:

http://doc.essentialobjects.com/library/1/clientapi_howto.aspx

Thanks
CJLopez
Posted: Friday, July 29, 2011 5:54:55 PM
Rank: Newbie
Groups: Member

Joined: 7/29/2011
Posts: 4
woot, pretty much that did the job

Now, i'm facing a couple of new issues

When the job is done, i have on my dialog a Ok btn to close the dialog

Code: HTML/ASPX
<eo:Dialog ID="Dialog1" runat="server" CssClass="REPORTE" BackColor="White" Height="50px" Width="200px" HeaderHtml ="Exportación en Proceso" BorderStyle ="Solid"
            BackShadeColor="Orange" ShadowDepth="3" AcceptButton="btnOk" ClientSideOnCancel="OnDialogCancel" ClientSideOnAccept="OnDialogAccept">
	        <HeaderStyleActive CssClass="REPORTE_HeaderStyle"></HeaderStyleActive>
	        <ContentStyleActive CssClass="REPORTE_RowStyle"></ContentStyleActive>
            <ContentTemplate>
                <div id="divProgreso" style="text-align:center;"></div>
                <eo:ProgressBar ID="ProgressBar1" runat="server" ShowPercentage="True" IndicatorImage="00060104"
	            BackgroundImageRight="00060103" ControlSkinID="None" BackgroundImage="00060101" IndicatorIncrement="7" ClientSideOnTaskDone="exportacionTerminada"
	            BackgroundImageLeft="00060102" Width="150px" StartTaskButton="btnImportar" OnRunTask="ProgressBar1_RunTask" ClientSideOnValueChanged="OnProgress">
                    </eo:ProgressBar><br />                
            </ContentTemplate>
            <FooterStyleActive CssClass="REPORTE_FooterStyle"/>
            <FooterTemplate>
                <div style="text-align:center">
                    <asp:Button ID="btnOk" runat="server" Text="OK" 
                        Enabled="False"  UseSubmitBehavior="false"/>
                </div>
            </FooterTemplate>
        </eo:Dialog>


I had set the button to be the DailogAcceptButton, but to prevent the user form clicking the button before the process is finished, i disabled the button, so when the process is done, my function "exportacionTerminada" launches

Code: JavaScript
function exportacionTerminada()
        {
            var btn = document.getElementById("&lt;%=btnOk.ClientID%&gt;");
            btn.disabled = false;
        }


but the buttons stay disabled, any idea???
eo_support
Posted: Friday, July 29, 2011 6:20:06 PM
Rank: Administration
Groups: Administration

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

Your code looks quite fine to us. The dialog does not enable or disable your button, so it must have to do with something else. There are a number of other things you can try. One is to hide the button all together until your task is done. Another is to clear the dialog's AcceptButton property and call the dialog's close method to close the dialog with JavaScript when your button is clicked.

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.