diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java index 6ce335c..01e2b0e 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java @@ -6,6 +6,10 @@ import javafx.fxml.FXML; import javafx.scene.Node; import javafx.scene.control.*; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.List; + public class MenueController { @FXML @@ -71,14 +75,26 @@ public class MenueController { @FXML ComboBox cbPickChild; @FXML - Button btLogin; - @FXML Button btSaveOrder; @FXML ListView lvFoodInfo; public ObservableList buttons = FXCollections.observableArrayList(); + public ObservableList children = FXCollections.observableArrayList(); + public List allChildren = AccountMgr.getAllChildrenFromParentWithId(3); + public void initialize(){ + FoodPlan foodplanMon = FoodMgr.getFoodPlanById(1); + FoodPlan foodplanTue = FoodMgr.getFoodPlanById(2); + FoodPlan foodplanWed = FoodMgr.getFoodPlanById(3); + FoodPlan foodplanThu = FoodMgr.getFoodPlanById(4); + FoodPlan foodplanFri = FoodMgr.getFoodPlanById(5); + + for (Child c : allChildren){ + children.add(c.getFirstname()); + } + cbPickChild.setItems(children); + } public void setButtonActive(ActionEvent event) { Button b = (Button) event.getSource(); @@ -87,14 +103,7 @@ public class MenueController { buttons = p.getChildrenUnmodifiable(); for(Node button : buttons){ - System.out.println(b.getStyleClass()); - /* - b.getStyleClass().remove("active"); - - if (button.equals(b)){ - b.getStyleClass().add("active");; - } - */ + button.setDisable(button.equals(b)); } } }