Hello to all! The project on javafx springboot.
Made two tables one looks in a database, the second dynamic for the entities selected from base. Drag and drop should transfer selectable entities from the first table (database) to the second dynamic one. And then work with them. Whoever faced such tasks? Almost everything was done, but the dynamic table displays data in a geometrical progression. When selecting 1 row, it displays 2 rows and an increase. Dynamic table (here map-lu Entity from base to object for dynamic table):
private ObservableList<House> getHouseList(HousePrimaryRights housePrimaryRights) { List<House> newHouses = new ArrayList<>(); housesAllDinList = FXCollections.observableArrayList(newHouses); tableViewHouseUpdata = new TableView<>(housesAllDinList); if (housePrimaryRights != null) { IMergingContext context = new MergingContext(); House house = context.map(housePrimaryRights, House.class); newHouses.add(house); } else tableViewHouseUpdata.getItems().clear(); return housesAllDinList; Here I work to capture the desired rows in the table from the database.
tableViewHouseData.setOnMouseClicked(event -> { if (event.getClickCount() == 1) { tableViewHouseData.getSelectionModel().selectedItemProperty().addListener( (observable, oldValue, newValue) -> showHouseDetails(newValue)); buttonAdd.fire(); } });