| Issue 72: | SelectedItm of ComboBox is not set via bindWith | |
| 1 person starred this issue and may be notified of changes. | Back to list |
1. Setup a comboBox and bind to a property. Example (item1, item2, item3)
...
<combobox bindList="${selectList}" bindWith="selected" />
...
2. Set the value of selected default to item2 and start the app
3. Value of the comboBox is not set to item2
Cause:
I have checked the source of JComboBoxEx.java and found the problem in the addNotify() method. The binding to "selectedItem" is missing. I think, the binding of the items must be moved to before the bindWith binding is executed (To make the setSelectedItem has any effect) and replace the binding of text with a binding to selectedItem of the current class.
Example:
public void addNotify() {...
BindingUtils.initComboBinding(context, UpdateStrategy.READ_WRITE,...
context.bind();
if (getBindWith() != null) {...
Binding b = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, client, BeanProperty.create(getBindWith()), this, BeanProperty.create("selectedItem"));
if (getConverter() != null) {
b.setConverter(getConverter());
}
b.bind();
...
Sep 8, 2011
Project Member
#1
bartolom...@gmail.com
Status:
Fixed
|