ListSelectionView broken in 8.40.15
See original GitHub issueIn 8.40.15 the list selection view lists (target and source lists) seems to have stopped updating. Here is sample code demonstrating the problem:
package playing;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.controlsfx.control.ListSelectionView;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.embed.swing.JFXPanel;
import javafx.geometry.Orientation;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Dialog;
import javafx.util.Callback;
public class Playing
{
private ListSelectionView<String> view;
public Playing()
{
setup();
}
private void setup()
{
List<String> list = new ArrayList<>();
list.add("A");
list.add("B");
list.add("C");
list.add("D");
view = new ListSelectionView<>();
view.setOrientation(Orientation.HORIZONTAL);
MyResultConverter resultConverter = new MyResultConverter();
view.setTargetItems(FXCollections.observableList(list));
Platform.runLater(() ->
{
Dialog<List<String>> fxDialog = new Dialog<>();
fxDialog.setTitle("Select");
fxDialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
fxDialog.getDialogPane().setContent(view);
fxDialog.setResultConverter(resultConverter);
fxDialog.setOnCloseRequest(e -> processResults(fxDialog.getResult()));
fxDialog.show();
});
}
public static void main(String[] args)
{
new JFXPanel();
new Playing();
try
{
Thread.sleep(30000);
}
catch (InterruptedException e)
{
Thread.currentThread().interrupt();
}
}
/**
*
* This callback is used by the dialog when the user hits the ok/cancel buttons
*
*
*/
private class MyResultConverter implements Callback<ButtonType, List<String>>
{
@Override
public List<String> call(ButtonType b)
{
if (b == ButtonType.OK)
{
System.out.println("Sources: ");
view.getSourceItems().forEach(e -> System.out.print(e + "|"));
return view.getTargetItems();
}
else
{
return Collections.emptyList();
}
}
}
private void processResults(List<String> list)
{
System.out.println("Result: ");
list.stream().forEach(f -> System.out.println(f));
}
}
When you run the dialog and modify the list, the result always print A B C D for the target list. Reverting back to 8.40.14 fixes it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
ControlsFX - Google Groups
Hei there So I have the following problem. ... ListSelectionView keytyped on source or target items ... Avaibility of version 8.40.15 in MavenCentral....
Read more >ListSelectionView (ControlsFX Project 11.0.3)
A control used to perform a multi-selection via the help of two list views. Items can be moved from one list (source) to...
Read more >Recently Active 'controlsfx' Questions - Page 2 - Stack Overflow
I'm using OpenFX 11, OpenJDK 11 and controlsfx 8.40.15 library Getting Caused by: ... such as List Selection View, or List Action View...
Read more >ListSelectionView (ControlsFX Project 8.40.10) - Javadox
public class ListSelectionView<T>extends Control. A control used to perform a multi-selection via the help of two list views. Items can be moved from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ViniciusSSilva Ah, my bad. I was checking the date of commit instead of the date of merge.
If someone wants to try out the latest version, we release snapshot versions for ControlsFX.
The
11.0.0
Release was done before #1117 bug-fixI found a way to fix it using https://jitpack.io
add the arg:
--add-exports=javafx.base/com.sun.javafx.runtime=ALL-UNNAMED
pom.xml changes (with maven):
Edit: It is also possible to use the version from the original repository