Hi,
I'm migrating from a very old, previous version of 0.1 to the head of the project and I'm experiencing some problems. One thing I can't get to work is the ListBinder.
Previously, to create a JList I did the follow:
But ListBinder.MODEL_KEY doesn't exist anymore, and everytime I select one item in the list, instead of been selected, it disappears.Code:final SwingBindingFactory factory = (SwingBindingFactory) getBindingFactory(); this.selectedPCsObservableList = factory .createBoundListModel(LineForm.SELECTED_PCS); Map<String, Object> context = new HashMap<String, Object>(); context.put(AbstractListBinder.SELECTABLE_ITEMS_KEY, null); context.put(ListBinder.RENDERER_KEY, new BeanPropertyValueListRenderer( "code")); context.put(ListBinder.MODEL_KEY, this.selectedPCsObservableList); final Binding nodes = factory.createBinding(JList.class, LineForm.SELECTED_PCS, context); this.jlSelectedPCs = (JList) nodes.getControl();
The new code I'm trying is the follow:
I've tried some other signatures of SwingBindingFactory.createBoundList but them doesn't work as well.Code:final SwingBindingFactory factory = (SwingBindingFactory) getBindingFactory(); this.selectedPCsObservableList = factory .createBoundListModel(LineForm.SELECTED_PCS); final Binding nodes = factory.createBoundList(LineForm.SELECTED_PCS, this.selectedPCsObservableList, "code", ListSelectionModel.SINGLE_SELECTION);
What should I do to keep the previous behaviour of JList?
Thanks,
Mauro.


Reply With Quote
, so I'd be interested to hear whether it helped you.