PDA

View Full Version : ComboBox


richard.hallier
07-01-2008, 04:43 AM
Hi all,
I have 2 questions about combobox :
- What is the goal of the valueField attribute ? It seems useless for now

Imagine a combobox with a store of ModelData and the ModelData contains an "id" property. What is the best solution to set the value of the combobox based on an "id" value ? Have I to manually list store models to find the model matching the pk value, then use a setValue(ModelData) ?


Thank you.

darrellmeyer
07-09-2008, 10:42 PM
What is the goal of the valueField attribute ? It seems useless for nowYes, the value field is useless now since the fields were changed to use generics. I am removing it from combo.

Have I to manually list store models to find the model matching the pk value, then use a setValue(ModelData) ?Yes. I have added a new method to Store which will make the easier.

/**
* Returns the first model whose property matches the given value.
*
* @param property the property name
* @param value the value to match
* @return the model or null if no match
*/
public M findModel(String property, Object value) {
}Change is in SVN (1.1 code)