Wrong default value in comboBox?

  1. #1

    Wrong default value in comboBox?

    My problem is that when I select a country for the first time the states comboBox shows the number "1" which is the country "ID", and the states list of the states when I click the comboBox is ok.

    My question it is why the value "1" is setted by defaut when I select the country?

    I have the following code to retrieve the states when a country is selected:

    protected void ComboBoxContrySelect(object sender, AjaxEventArgs e)
    {
        string id = this.ComboBoxBILLINGCOUNTRYIDField.SelectedItem.Value.ToString();
        this.ObjectDataSourceComboBoxFechStateForCountry.SelectParameters["COUNTRYID"].DefaultValue = id;
        this.StoreComboBoxState.DataBind();
    }
    And the following are the fields:

    <ext:FormLayout ID="FormLayout7" runat="server" LabelAlign="Top">
        <ext:Anchor Horizontal="80%">
            <ext:ComboBox 
                ID="BILLINGCOUNTRYIDField"
                StoreID="StoreComboBoxCountry" 
                runat="server" 
                Editable="false"
                ValueField="ID" 
                DisplayField="NAME" 
                FieldLabel="Country">
                <AjaxEvents>
                    <select OnEvent="ComboBoxContrySelect"/>
                </AjaxEvents>
            </ext:ComboBox>
        </ext:Anchor>
        <ext:Anchor Horizontal="80%">
            <ext:ComboBox 
                ID="BILLINGREGION2IDField" 
                runat="server" 
                FieldLabel="State"
                StoreID="StoreComboBoxState" 
                EmptyText="Select a state..."
                ValueField="ID" 
                DisplayField="NAME" 
                ForceSelection="true" 
                />
        </ext:Anchor>
    Thanks,

  2. #2

    RE: Wrong default value in comboBox?

    Hi,

    How do you set selection for combo? Please post full test sample
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    RE: Wrong default value in comboBox?



    I am sorry I do not understand the question.

    I just put this question again with the code on the Premium Forum.

    Thanks,

  4. #4

    RE: Wrong default value in comboBox?

    I just put this question again with the code on the Premium Forum.
    Can you post a link to your new forum topic related to this issue?


    Geoffrey McGill
    Founder & CEO
  5. #5

    RE: Wrong default value in comboBox?



    The following is the link of this topic on the premium forum.

    http://forums.ext.net/showthread.php...6280-16-1.aspx

Similar Threads

  1. ComboBox default value with razer
    By zhdl in forum 2.x Help
    Replies: 0
    Last Post: Aug 13, 2012, 9:59 AM
  2. Replies: 0
    Last Post: Jul 27, 2012, 8:37 PM
  3. ComboBox Default Selection
    By josmar52789 in forum 1.x Help
    Replies: 1
    Last Post: Sep 02, 2009, 2:55 PM
  4. Replies: 1
    Last Post: May 25, 2009, 7:00 PM
  5. ComboBox - Add Default Item
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Feb 03, 2009, 4:26 PM

Posting Permissions