[CLOSED] SelectBox tab to focus and select issue

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] SelectBox tab to focus and select issue

    Hello,
    I have a form with data entry fields, one of the fields is a Select Box that I want the user to be able to type a letter and the SelectBox options will display with first matching item selected. If the user mouse clicks on the SelectBox it works fine, But if you Tab through the fields to the SelectBox and type a letter an error is thrown: 'this.picker.listEl' is null or not an object

    Seems tabbing to the box isn't initializing the 'pick list', is there a way to make that happen? Here's my example page

    <%@ Page Language="C#" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
        
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                boxStore.DataSource = myData;
                selBox1.SelectedItems.Add(new Ext.Net.ListItem() { Value = "L" });
            }
        }
        private List<object> myData
        {
            get
            {
                List<object> box = new List<object>
                    {   new { Descr = "Consumer", Code = "L" },
                        new { Descr = "Consumer Suppress", Code = "Q" },
                        new { Descr = "Business", Code = "N" },
                        new { Descr = "Business Suppress", Code = "R" },
                        new { Descr = "Canadian Consumer", Code = "C" },
                        new { Descr = "Canadian Consumer Suppress", Code = "W" },
                        new { Descr = "Other / Backend", Code = "O" },
                        new { Descr = "Zip Tape", Code = "Z" }
                   };
                return box;
            }
        } 
    </script>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager runat="server"></ext:ResourceManager>
        <ext:FormPanel ID="FormPanel1" runat="server" Layout="TableLayout" Title="Test Panel" BodyPadding="10" Width="500">
            <LayoutConfig>
                <ext:TableLayoutConfig Columns="2"></ext:TableLayoutConfig>
            </LayoutConfig>
            <Items>
                <ext:TextField ID="txt1" runat="server" FieldLabel="Text 1" AllowBlank="false"></ext:TextField>
                <ext:TextField ID="txt2" runat="server" FieldLabel="Text 2" AllowBlank="false"></ext:TextField>
                <ext:SelectBox ID="selBox1" runat="server" FieldLabel="Select Box" DisplayField="Descr" ValueField="Code" Size="20">
                    <Store>
                        <ext:Store ID="boxStore" runat="server">
                            <Model>
                                <ext:Model runat="server">
                                    <Fields>
                                        <ext:ModelField Name="Descr"></ext:ModelField>
                                        <ext:ModelField Name="Code"></ext:ModelField>
                                    </Fields>
                                </ext:Model>
                            </Model>
                            <Sorters>
                                <ext:DataSorter Property="Descr" Direction="ASC"></ext:DataSorter>
                            </Sorters>
                        </ext:Store>
                    </Store>
                </ext:SelectBox>
            </Items>
        </ext:FormPanel>
        </form>
    </body>
    </html>
    Last edited by Baidaly; Mar 27, 2013 at 9:12 PM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] Infinite scrolling grid select row and focus
    By ASAPCH in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 26, 2012, 6:27 PM
  2. Replies: 0
    Last Post: Jul 08, 2012, 2:55 PM
  3. Replies: 3
    Last Post: Apr 04, 2012, 10:36 AM
  4. [CLOSED] select number on focus
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 12, 2011, 3:16 PM
  5. [CLOSED] [1.0] SelectBox Select event fires twice
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 09, 2009, 2:20 PM

Posting Permissions