PDA

View Full Version : Wrong default value in comboBox?



flormariafr
Jan 23, 2010, 2:22 PM
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.Va lue.ToString();
this.ObjectDataSourceComboBoxFechStateForCountry.S electParameters["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,

Vladimir
Jan 26, 2010, 10:55 AM
Hi,

How do you set selection for combo? Please post full test sample

flormariafr
Jan 26, 2010, 5:12 PM
I am sorry I do not understand the question.

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

Thanks,

geoffrey.mcgill
Jan 26, 2010, 5:48 PM
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?

flormariafr
Jan 26, 2010, 10:12 PM
The following is the link of this topic on the premium forum.

http://forums.ext.net/showthread.php?threadid=26280-16-1.aspx