My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 72: SelectedItm of ComboBox is not set via bindWith
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Sep 2011


 
Reported by 9767...@googlemail.com, Sep 8, 2011
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
hi 

thx for feedback

I've verified the issue, fix it (using your example) and deployed a new SNAPSHOT (2.5-SNAPSHOT)

try it and let me know ... so i can arrange a new version

FYI: The SNAPSHOT repository is https://oss.sonatype.org/content/repositories/snapshots
Status: Fixed

Powered by Google Project Hosting