You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for sharing this code. It's been realy helpful in lot of situations!
I am experiencing some strange behaviour with 'EasyBind.map'. My goal is to derive a list of conditions (Strings) from a collection of buisiness objects, that will be passed to the application server on a search request.
What I am seeing is that 'conditions' is always emtpy because 'conditions' will not be updated although the 'selectedItems' change.
The following code has a dependency on ControlsFX (8.20.7). If you run it like this and check the first entry in the combo box, only the 'ListChangeListener' on 'selectedItems' will fire, but not the one on the 'MappedList'.
Now please uncomment the two lines 74 and 75:
ListView<String> selectedView = new ListView<String>(lastNames);
box.getChildren().add(selectedView);
and run the program again. Now, if an item is checked, the selection will be displayed in the new list and both 'ListChangeListener' instances are called!
I haven't run your code, but it looks like lastNames is garbage collected (together with the attached listener). This is the trouble with weak listeners---selectedItems only holds a weak reference to the mapped list. You get the same problem with bindings from JavaFX, e.g. widthProperty().add(10.0).addListener(/* may never execute */).
Make sure you maintain a reference to the mapped list and let me know if that solved your problem.
Hello
Thanks a lot for sharing this code. It's been realy helpful in lot of situations!
I am experiencing some strange behaviour with 'EasyBind.map'. My goal is to derive a list of conditions (Strings) from a collection of buisiness objects, that will be passed to the application server on a search request.
Basically, what I am doing is this:
What I am seeing is that 'conditions' is always emtpy because 'conditions' will not be updated although the 'selectedItems' change.
The following code has a dependency on ControlsFX (8.20.7). If you run it like this and check the first entry in the combo box, only the 'ListChangeListener' on 'selectedItems' will fire, but not the one on the 'MappedList'.
Now please uncomment the two lines 74 and 75:
and run the program again. Now, if an item is checked, the selection will be displayed in the new list and both 'ListChangeListener' instances are called!
The text was updated successfully, but these errors were encountered: