Welcome Guest Search | Active Topics | Sign In | Register

CallbackPanel not worked. Options
Maxim
Posted: Sunday, January 18, 2009 9:28:42 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
Code: HTML/ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Partners.ACD.WebSite.Test"  %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title></title>
</head>
<body>
    <form runat="server">
    <asp:ScriptManager runat="server" ID="scr"></asp:ScriptManager>
    
        <eo:CallbackPanel runat="server" ID="qwe" ClientSideBeforeExecute="test">
            <asp:Button ID="Button1" runat="server" />
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        </eo:CallbackPanel>
        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
        <script type="text/javascript">
            function test(calb) {
                alert('qwe');
            }
        </script>
    </form>
</body>
</html>


All page is updated and not execute JS function Test.
What i do wrong?
Maxim
Posted: Sunday, January 18, 2009 10:04:45 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
I Understand. I am not write a parameter of CallbackPanle Trigger.
But if i want update callback panel if clicked on any control inside callback panel...?
eo_support
Posted: Sunday, January 18, 2009 11:08:47 AM
Rank: Administration
Groups: Administration

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

You would put them inside a Panel and then set the Panel as a trigger. Setting a parent control as a trigger automatically means set all children controls as triggers.

Thanks
Maxim
Posted: Sunday, January 18, 2009 11:15:55 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
How?

Code: HTML/ASPX
<eo:CallbackPanel runat="server" ID="qwe" UpdateMode="Conditional" ClientSideBeforeExecute="test" AutoDisableContent="True" Triggers="{ControlID:pane;Parameter:}">
        <asp:Panel runat="server" ID="pane">
            <asp:Button ID="Button1" runat="server" />
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Button ID="Button2" runat="server" />
        </asp:Panel>
        </eo:CallbackPanel>


or
Code: HTML/ASPX
<asp:Panel runat="server" ID="pane">
        <eo:CallbackPanel runat="server" ID="qwe" UpdateMode="Conditional" ClientSideBeforeExecute="test" AutoDisableContent="True" Triggers="{ControlID:pane;Parameter:}">
            <asp:Button ID="Button1" runat="server" />
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Button ID="Button2" runat="server" />
        </eo:CallbackPanel>
        </asp:Panel>


All parts not worked.

Thanks!
eo_support
Posted: Monday, January 19, 2009 8:42:15 AM
Rank: Administration
Groups: Administration

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

The first one is the correct form, however the current version only works with parent control that implements INamingContainer. Panel does not implement this interface so it does not work. We have posted a new build that removed this restriction. Please see your private message for the download location.

Thanks!
Maxim
Posted: Tuesday, January 20, 2009 2:00:26 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
I was install new version. Thanks.
With panel it's worked.
But if i set UpdateMode="Conditional" then panel is not updated.
If in server side on Button1_CLick write qwe.update() then i take this message:
"The current request is not a callback request triggered by EO.Web Callback or EO.Web.CallbackPanel."

But if i set UpdateMode="Self" then all worked but i can't update one callbackpanel data from other callbackpanel.
eo_support
Posted: Tuesday, January 20, 2009 4:27:28 AM
Rank: Administration
Groups: Administration

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

That's the normal behavior. You don't need to call Update when the request is a normal reques.t because everything in the page, including all CallbackPanels, will be updated. You can call CallbackPanel1.IsCallback to check whether the current request is callback and only call Update when IsCallback returns true.

Thanks
Maxim
Posted: Thursday, January 22, 2009 11:10:12 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
if i rise event from button1 or button2 (this buttons inside qwe callbackpanel) then event handled on the server, but UI not updated. If on server side in button1_click or button2_click i write
if (qwe.IsCallback)
qwe.Update();
then all worked. If not write this, then site crash with error

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.


I think it's not normal behavior. I think that qwe.update need call when i handle event from different callbackpanel (not from qwe).
eo_support
Posted: Thursday, January 22, 2009 11:16:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Maxim wrote:
I think it's not normal behavior. I think that qwe.update need call when i handle event from different callbackpanel (not from qwe).


This is correct. qwe.Update need to be called when you handle event from any CallbackPanel. However qwe.IsCallback returns true as soon as any CallbackPanel triggers. In another word, as soon as the current page is from a CallbackPanel, callback1.IsCallback would return true, callback2.IsCallback would return true, every CallbackPanel's IsCallback would return true. So it does not matter which one's IsCallback you are checking.
Maxim
Posted: Thursday, January 22, 2009 12:26:41 PM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
eo_support wrote:
This is correct

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.