Bugs in Samples: [AjaxEvent in Toolbar/Menu Item ] [ status bar ]

  1. #1

    Bugs in Samples: [AjaxEvent in Toolbar/Menu Item ] [ status bar ]

    Hi Gents,

    I should thank for your great great effort.


    the following examples have problem:

    <ul style="padding-left: 50px;">[*]https://examples1.ext.net/Examples/T...sBar/Overview/
    <div style="padding-left: 50px;">
    Server Error in '/' Application.

    --------------------------------------------------------------------------------


    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.


    Compiler Error Message: CS1061: 'Coolite.Ext.Web.Button' does not contain a definition for 'Enable' and no extension method 'Enable' accepting a first argument of type 'Coolite.Ext.Web.Button' could be found (are you missing a using directive or an assembly reference?)


    Source Error:




    Line 25:

    Line 26: statusBar.SetStatus(new StatusBarStatusConfig("Updated: " + DateTime.Now.ToLongTimeString() + " (server time)", " "));

    Line 27: button.Enable();

    Line 28: }

    Line 29:



    Source File: d:\wwwroot2\examples.ext.net\Examples\Toolbar\Stat usBar\Overview\Default.aspx Line: 27


    [*]https://examples1.ext.net/Examples/T...Menu/Overview/

    <div style="padding-left: 50px;">If I click on the With menu->Menu3 to trigger the server side code "Menu3_Click" event handler, nothing happens.

    [/list]

    I have tried these screens with IE7 and Fox pro 3.0.10.
    These problems does not exist in version 0.7.0.

    All the best
  2. #2

    RE: Bugs in Samples: [AjaxEvent in Toolbar/Menu Item ] [ status bar ]

    Hi again


    I could realize what is the problem with the second bug I mentioned. I spotted the difference inside the source code in version 0.7 and 0.8.

    version 0.7:
    protected void Menu3_Click(object sender, AjaxEventArgs e)
        {
            this.ScriptManager2.AddScript("alert('{0}');", e.ExtraParams["Param"]);
        }
    version 0.8:
    protected void Menu3_Click(object sender, AjaxEventArgs e)
        {
            Ext.Msg.Alert("Click", e.ExtraParams["Param"]);
        }
    ----------------------------------------------------------------------------------------------------------
    <div align="left">

    RESOLUTION

    ----------------------------------------------------------------------------------------------------------

    If you change the sample code in a way it looks like the following code then it'll work.
    
    protected void Menu3_Click(object sender, AjaxEventArgs e)
        {
            Ext.Msg.Alert("Click", e.ExtraParams["Param"]).Show();
        }
    ----------------------------------------------------------------------------------------------------------

    <div align="left">

    ANOTHER ISSUE



    ----------------------------------------------------------------------------------------------------------
    I also tried to change the current view of a MultiView, but still unsuccessful. I tried using both AjaxEvent and AjaxMethod.

    It appears that only the coolite controls get re-rendered and we actually cannot use standard ASP.NET controls. Please correct me if I'm wrong.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Scrutiniser.Presentation.Web.WebForm2" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <script runat="server">
            protected void AjaxEventHandler(object sender, Coolite.Ext.Web.AjaxEventArgs e)
            {
                TextBox1.Text = DateTime.Now.ToLongTimeString();
                TextField1.Text = DateTime.Now.ToLongTimeString();
                TextArea1.Text = DateTime.Now.ToLongTimeString();
                this.MultiView1.ActiveViewIndex = 1;
                Coolite.Ext.Web.Ext.Msg.Alert("app", "done").Show();
            }
            [AjaxMethod]
            public void MyAjaxMethod()
            {
                TextBox1.Text = DateTime.Now.ToLongTimeString();
                TextField1.Text = DateTime.Now.ToLongTimeString();
                TextArea1.Text = DateTime.Now.ToLongTimeString();
                this.MultiView1.ActiveViewIndex = 0;
                Coolite.Ext.Web.Ext.Msg.Alert("app", "done").Show();
                
            }
        </script>
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        
            <ext:ScriptManager ID="ScriptManager1" runat="server">
            </ext:ScriptManager>
            <ext:Window ID="Window1" runat="server" Collapsible="false" Icon="Application" 
                Title="sample" Closable="False" Height="437px" Width="686px">
                <TopBar>
                    <ext:Toolbar runat="server" >
                        <Items>
                            <ext:ToolbarButton runat="server" Text="AjaxEventHandler">
                                <AjaxEvents>
                                    <Click OnEvent="AjaxEventHandler" >
                                        <EventMask ShowMask="true" />
                                    </Click>
                                </AjaxEvents>
                            </ext:ToolbarButton>
                            <ext:ToolbarButton ID="ToolbarButton1" runat="server" Text="MyAjaxMethod">
                                <Listeners>
                                    <Click Handler="#{AjaxMethods}.MyAjaxMethod();" />
                                </Listeners>
                            </ext:ToolbarButton>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Body>
                    standard ASP.NET Text Box: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    <br />
                    Coolite TextField : <ext:TextField ID="TextField1" runat="server"></ext:TextField>
                    <br />
                    Coolite TextArea: <ext:TextArea ID="TextArea1" runat="server"></ext:TextArea>
                    <br />
                    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
                        <asp:View ID="View1" runat="server">
                            this is view 1111111111111111111111111 
                        </asp:View>
                        <asp:View ID="View2" runat="server">
                            this is view 222222222222222222222222
                        </asp:View>
                    </asp:MultiView>
                </Body>
            </ext:Window>
            
            
        
    
        </form>
    </body>
    </html>


Similar Threads

  1. Replies: 8
    Last Post: Jul 29, 2012, 10:58 AM
  2. Replies: 2
    Last Post: May 28, 2012, 1:54 PM
  3. Replies: 2
    Last Post: Apr 02, 2012, 7:48 AM
  4. [CLOSED] Always selected Item is nothing for combobox as menu item
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 04, 2011, 4:51 PM
  5. [CLOSED] Menu inside Component menu item
    By tansu in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 15, 2010, 2:32 PM

Posting Permissions