Aug 05, 2009, 2:36 AM
ComboBox bug Value equals Text
I have a details popup panel to see details of a selected record in a gridpanel. Everytime I popup the details panel I load a combobox with inner items like so:
cmbMessageCats.Items.Clear();
cmbMessageCats.Items.Add(new Coolite.Ext.Web.ListItem("Christmas", "5"));
cmbMessageCats.Items.Add(new Coolite.Ext.Web.ListItem("General", "1"));
cmbMessageCats.Items.Add(new Coolite.Ext.Web.ListItem("Valentine's Day", "4"));
cmbMessageCats.SelectedItem.Value = "1"; //default to general
if I put a break point and look at the ItemsToStore private variable it's set to:
new Ext.data.SimpleStore({fields:['text','value'],data :[["Christmas","5"],["General","1"],["Valentines Day","4"]]})
which is good. It shows all three items in the combobox "Christmas", "General", and "Valentines Day" with "General" selected.
However after a few times displaying the details panel and closing, it no longer shows "General" but shows "1" and no other items are displayed. When I put a breakpoint on it the ComboBox's Text = "1" and Value="1", but still the ItemsToStore field shows the same data as above with the correct Description and ID.
The only way I can get the combobox to load the data and display data correctly is to stop my project in VS, and relaunch again.
What is going on?
Jason