[CLOSED] combobox inside a menu and directevent

  1. #1

    [CLOSED] combobox inside a menu and directevent

    Hello
    I think this is a bug unless it is supposed to work so, in that case I still need a solution.
    I have a combox inside a menu (of a button) and when the selection changes the selected item is null. This is not the case if it is outside the menu. See example:
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
    
    
            Store1.DataSource = new object[]
            {
                new object[] { "AL", "Alabama", "The Heart of Dixie" },
                new object[] { "AK", "Alaska", "The Land of the Midnight Sun" },
                new object[] { "AZ", "Arizona", "The Grand Canyon State" },
                new object[] { "AR", "Arkansas", "The Natural State" },
                new object[] { "WY", "Wyoming", "Like No Place on Earth"} 
            };
    
            Store1.DataBind();
        }
    
        protected void ComboChanged(object sender, DirectEventArgs e)
        {
            ComboBox cmbo = sender as ComboBox;
            var text = "";
            if (cmbo != null)
            {
                text = cmbo.SelectedItem.Value != null ? cmbo.SelectedItem.Value : "null";
            }
            else
            {
                text = "sender object should be of type combobox";
            }
            InfoLabel.Text = text; 
        }
    </script>
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>SelectBox - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Store ID="Store1" runat="server">
            <Model>
                <ext:Model ID="Model1" runat="server">
                    <Fields>
                        <ext:ModelField Name="abbr" />
                        <ext:ModelField Name="state" />
                        <ext:ModelField Name="nick" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
    
            <ext:Label ID="InfoLabel" runat="server" Text="select something and you'll see the selected value here">
        </ext:Label>
    
    
        <ext:ComboBox runat="server" ID="CmboProfileList" DisplayField="state" ValueField="abbr"
            Mode="Local" StoreID="Store1">
            <DirectEvents>
                <Select OnEvent="ComboChanged" />
            </DirectEvents>
        </ext:ComboBox>
        <ext:Button runat="server" Text="Button with Menu">
            <Menu>
                <ext:Menu ID="Menu2" runat="server">
                    <Items>
    
                        <ext:ComboBox runat="server" ID="ComboBox1" DisplayField="state" ValueField="abbr"
                            Mode="Local" StoreID="Store1">
                            <DirectEvents>
                                <Select OnEvent="ComboChanged" />
                            </DirectEvents>
                        </ext:ComboBox>
    
                        <ext:Label Text="item2" />
                        <ext:Label Text="item3" />
                    </Items>
                </ext:Menu>
            </Menu>
        </ext:Button>
        </form>
    </body>
    </html>
    Last edited by Daniil; Jun 12, 2013 at 8:43 AM. Reason: [CLOSED]
  2. #2
    Hello!

    Please, take a look at this post: http://forums.ext.net/showthread.php...ll=1#post99189
  3. #3

    [closed]

    Quote Originally Posted by Baidaly View Post
    Hello!

    Please, take a look at this post: http://forums.ext.net/showthread.php...ll=1#post99189
    excellent! so setting RenderToForm="true" solves it.
    Thanks Baidaly.

Similar Threads

  1. [CLOSED] Update SplitButton menu on DirectEvent?
    By rthiney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 07, 2013, 4:10 AM
  2. Insert a Menu inside a Menu
    By martinr84 in forum 1.x Help
    Replies: 0
    Last Post: Jul 16, 2012, 8:27 PM
  3. Replies: 2
    Last Post: Sep 21, 2010, 11:14 AM
  4. [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
  5. [CLOSED] How to add menu items in a DirectEvent
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 18, 2010, 11:01 AM

Posting Permissions