[OPEN] ComboBox Value

  1. #1

    [OPEN] ComboBox Value

    Hello,

    The example below will demonstrate that I can not submit a value in a ComboBox that is not in the list:

    <%@ Page Language="C#" %>
    <%@ 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">
    <script runat="server">
    protected void btnDemo_Click(object sender, AjaxEventArgs e)
    {
        lblTest.Text = "Omg ... you selected: " + drpEmployeeRole.SelectedItem.Value;
    }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <p><a href="Example.aspx">Reload</a></p>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" />
            <ext:ScriptManager ID="ScriptManager2" runat="server" Theme="Gray" />
            <ext:ComboBox ID="drpEmployeeRole"
                runat="server"
                Editable="True"
                EmptyText="Provide a Member Role ..."
                Width="185">
                <Items>
                    <ExtJS:ListItem Text="Consultant" />
                    <ExtJS:ListItem Text="Coordinator" />
                    <ExtJS:ListItem Text="Project Coordinator" />
                    <ExtJS:ListItem Text="Project Manager" />
                </Items>
            </ext:ComboBox>
            <ext:Button ID="btnDemo" runat="server" AutoPostBack="False" Text="Save">
                <AjaxEvents>
                    <Click OnEvent="btnDemo_Click" />
                </AjaxEvents>
            </ext:Button>
            <ext:Label ID="lblTest" runat="server" Text="Waiting ..." />
        </form>
    </body>
    </html>
    Replication steps:

    1. Enter "Timothy" into Combobox
    2. Click "Save"
    3. Notice it doesn't show Timothy as selected
    4. Select "Consultant" from Combobox (or type it)
    5. Click "Save"
    6. Notice it knows my selection

    I thought it might be the SelectedItem property, because I haven't really selected anything, but even the underlying Value property is null. Have I missed a property setting to make this work?

    Cheers,
    Timothy
  2. #2

    RE: [OPEN] ComboBox Value

    any update on this? i've got the same problem.
    Thanks.
  3. #3

    RE: [OPEN] ComboBox Value

    Hi,

    The solution is set ForceSelection="false" for ComboBox

Similar Threads

  1. [CLOSED] Forcing combobox to remain open after selection
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 30, 2011, 9:38 PM
  2. [CLOSED] Open ComboBox on Click?
    By iansriley in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 20, 2011, 12:58 PM
  3. Replies: 5
    Last Post: Jun 16, 2009, 1:27 PM
  4. Replies: 3
    Last Post: Mar 30, 2009, 1:53 PM
  5. [OPEN] ComboBox Rendering issue
    By Timothy in forum Bugs
    Replies: 7
    Last Post: Sep 30, 2008, 5:33 PM

Posting Permissions