@@ -134,9 +134,7 @@ public class ExternalProjectsSyncController {
134134
135135 private final LocalTimeStringConverter localTimeStringConverter = new LocalTimeStringConverter (FormatStyle .MEDIUM );
136136
137- private SearchPopup <HeimatTask > heimatTaskSearchPopup ;
138137 private ObservableList <TableRow > items ;
139- private ObservableList <TableRow > itemsForBindings ;
140138
141139 private LocalDate currentReportDate ;
142140 private Stage thisStage ;
@@ -169,7 +167,7 @@ public void initForDate(LocalDate currentReportDate, List<Work> currentWorkItems
169167
170168 mappingTableView .setItems (items );
171169
172- itemsForBindings = FXCollections .observableArrayList (
170+ ObservableList < TableRow > itemsForBindings = FXCollections .observableArrayList (
173171 item -> new javafx .beans .Observable [] { item .userTimeSeconds , item .shouldSyncCheckBox , item .userNotes });
174172 itemsForBindings .addAll (items );
175173 StringBinding totalSum = Bindings .createStringBinding (() -> localTimeStringConverter .toString (
@@ -210,7 +208,7 @@ public void initForDate(LocalDate currentReportDate, List<Work> currentWorkItems
210208 tasksNotInList .setPredicate (predicate );
211209 });
212210
213- heimatTaskSearchPopup = new SearchPopup <>(tasksNotInList );
211+ SearchPopup < HeimatTask > heimatTaskSearchPopup = new SearchPopup <>(tasksNotInList );
214212 heimatTaskSearchPopup .setDisplayTextFunction (task -> task .taskHolderName () + " - " + task .name ());
215213
216214 heimatTaskSearchPopup .setOnItemSelected ((selectedTask , popup ) -> {
@@ -228,8 +226,8 @@ public void initForDate(LocalDate currentReportDate, List<Work> currentWorkItems
228226 new HeimatController .Mapping (selectedTask .id (), true , true , syncMessage , "" , List .of (), List .of (), "" ,
229227 "" , 0 , 0 ), "" , 0 );
230228 items .add (addedRow );
231- itemsForBindings .add (addedRow );
232- mappingTableView .scrollTo (items .size () - 1 );
229+ itemsForBindings .add (addedRow ); // add new row also to items2 - as it is not added automatically :(
230+ mappingTableView .scrollTo (items .size () - 1 ); // scroll to newly added row
233231 });
234232 heimatTaskSearchPopup .setClearFieldAfterSelection (true );
235233
0 commit comments