ComboBox and New item

  1. #1

    ComboBox and New item

    Hi,

    I've one editable ComboBox loaded with store databinding. The user can write a free text into combobox but when control lost focus the user text is erased.

    the logic process is this:
    1. load the combobox with sotre (associated to an ObjectDataSource)
    2. The user can select an item in the list
    3. else can write a new item
    4. alfter when postback the page, if the item into combobox in new then save it

    I hope that I explained
    Thanks
    Valeriano
  2. #2

    RE: ComboBox and New item

    Hi,

    Set ForceSelection="false" for ComboBox
  3. #3

    RE: ComboBox and New item

    I try it, but if set ForceSelection="false"
    when i type a text into combo, it does not autoselect item
    but any text i type it select the first element.

    this is code:

        <ext:store ..... />
    
        <ext:ComboBox 
                AutoPostBack="true"
                Width="384px"
                ID="ComboBox1"
                runat="server" 
                StoreID="Store1" 
                Editable="true"
                DisplayField="Country"
                ValueField="ID"
                TypeAhead="true" 
                ForceSelection="false"
                TriggerAction="All"
                EmptyText="Select country..."
                Select&#111;nfocus="true">
            </ext:ComboBox>
  4. #4

    RE: ComboBox and New item

    Hi,

    You need remove TypeAhead also because TypeAhead can't be used with allowing to type custom values
  5. #5

    RE: ComboBox and New item

    Hi,

    I've removed TypeAhead but when type a text
    the combo don't autoselect the item if it exist
    and the relative SelectedItem.Value is always set on text displayed
    not on the valueField (if exists)


    Valeriano
  6. #6

    RE: ComboBox and New item

    Hi,

    If you set ForceSelection="false" (custom values allowing) then will be ready that you will get text only even for items from list because custom text has no value


    The following topic should helps
    http://forums.ext.net/showthread.php...5169-16-1.aspx

Similar Threads

  1. [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
  2. combobox item selecting bug ! please help
    By relativ in forum 1.x Help
    Replies: 0
    Last Post: Nov 24, 2009, 4:31 AM
  3. Select a item in a Combobox
    By eliezer in forum 1.x Help
    Replies: 1
    Last Post: Apr 16, 2009, 12:23 PM
  4. Get Combobox Selected item
    By yarlenvas in forum 1.x Help
    Replies: 3
    Last Post: Mar 08, 2009, 2:04 PM
  5. ComboBox - Add Default Item
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Feb 03, 2009, 3:26 PM

Posting Permissions