Welcome Guest Search | Active Topics | Sign In | Register

ASync Callback Options
Maxim
Posted: Tuesday, April 21, 2009 3:58:55 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
I Have 2 simple CallbackPanel:

Code: C#
<eo:CallbackPanel runat="server" ID="qwe1"  UpdateMode="Conditional" AutoDisableContent="True" Triggers="{ControlID:pane;Parameter:}"cmt:d8517600-9a54-4e4f-8773-7b81e72f2ea8--
<asp:Panel runat="server" ID="pane"cmt:723277e9-b5b6-48fe-871e-f981fe583771--
    <asp:Button ID="Button1" runat="server" Text="Button1"cmt:bbac5d00-7c19-42ca-965b-4d7558c816a9--</asp:Button>
    <asp:TextBox ID="TextBox1" runat="server"cmt:db911005-d8dd-45d7-b05d-8b55f892a051--</asp:TextBox>
</asp:Panel>
</eo:CallbackPanel>


Code: C#
<eo:CallbackPanel runat="server" ID="qwe2" UpdateMode="Conditional" Triggers="{ControlID:Panel1;Parameter:}"cmt:0ec1383f-0e5a-4398-a42b-e5253b15459d--
    <asp:Panel runat="server" ID="Panel1"cmt:03e97984-6700-41ca-9ad7-94da1b852eb9--
        <asp:Button ID="Button2" Text="Button2" runat="server" />
        <asp:TextBox ID="TextBox2" runat="server"cmt:d6066e00-e894-4e90-8bb5-41171eb28387--</asp:TextBox>
    </asp:Panel>
</eo:CallbackPanel>


I try run callback asynchronious:

Code: C#
<asp:Button ID="Button1" runat="server" Text="ButtonCallback"  OnClientClick="qwe(); return false;" />
        <script type="text/javascript"cmt:0770aae0-d378-4c25-b096-c9f61f418a01--
            function qwe() {
                setTimeout("eo_Callback('qwe2', null)", 100);
                setTimeout("eo_Callback('qwe1', null)", 1500);
            }
        </script>


if i set in .cs in OnExecute method Thread.Sleep(xxx); when the result is returned, the elements are displayed simultaneously

How can i execute async? Thanks.
Maxim
Posted: Tuesday, April 21, 2009 4:00:52 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
Code: JavaScript
function qwe() {
                setTimeout("eo_Callback('qwe2', null)", 100);
                setTimeout("eo_Callback('qwe1', null)", 1500);
            }
Maxim
Posted: Tuesday, April 21, 2009 4:14:25 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
In general. I want to have two panels with different content. If one panel will receive information before others, I want it to display, and another panel later.
eo_support
Posted: Tuesday, April 21, 2009 8:36:28 AM
Rank: Administration
Groups: Administration

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

You can trigger the second one after the first one is done by handling the first CallbackPanel's ClientSideAfterUpdate event:

http://doc.essentialobjects.com/library/1/eo.web.callbackpanel.clientsideafterupdate.aspx

Note even inside ClientSideAfterUpdate, you should still use setTimeout with a small time out value to trigger the second callback. Do not call eo_Callback inside ClientSideAfterUpdate directly.

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.