|==========| |==========|
| Expenses | | Allocations |
|==========| |==========|
+ ID +ID
+ Date +Type
+ Amount ===========
+ Allocations
Chcąc uzupełnić TableView z wynikami tabeli Expenses, w jaki sposób mógłbym w miejsce Allocations wstawić Type(gdzie Type jest Stringiem).
Z marnym skutkiem wypociłem taki niedziałający bzik:
@FXML
private TableView tableView;
@FXML
private TableColumn<ExpenseView, String> dateColumn;
@FXML
private TableColumn<ExpenseView, Integer> amountColumn;
@FXML
private TableColumn<AllocationView, String> sourceAndAllocationColumn;
public void initialize(){
ExpensesManager.queryForAll();
tableView.setItems(ExpensesManager.getExpensesObservableList());
dateColumn.setCellValueFactory(cell -> cell.getValue().dateProperty());
amountColumn.setCellValueFactory(cell -> cell.getValue().amountProperty().asObject());
sourceAndAllocationColumn.setCellValueFactory(cell -> cell.getValue().typeProperty());
}