Skip to content
Snippets Groups Projects
Commit b9ba35cd authored by Timo Jeremy Pinzauti's avatar Timo Jeremy Pinzauti
Browse files

Folgende Bugs wurden behoben:

- Abbrechen Button in ArtikelerstellungsView führt jetzt auf die WelcomeView zurück.
- Wenn Dienstleistung ausgewählt, dann sind die Verfügbarkeitsfelder aktiv, sonst inaktiv.
- Zustand des Artikels wurde auskommentiert, da dieses Attribut aktuell noch nicht in der DB vorhanden ist.
parent 5da54175
Branches Anforderungen
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
*/
package org.s4s.gui.views;
import com.vaadin.data.Property;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.server.FileResource;
......@@ -75,13 +76,15 @@ public class ArtikelerstellungsView extends TemplateView implements View {
final TextArea taBeschreibung = new TextArea("Artikel Beschreibung:");
final Label lMaxLength = new Label("Max. 250 Zeichen");
final NativeSelect nsKategorie = new NativeSelect("Kategorie:");
final NativeSelect nsZustand = new NativeSelect("Gebrauchszustand:");
// final NativeSelect nsZustand = new NativeSelect("Gebrauchszustand:"); <--- Aktuell noch nicht enthalten
final TextField tfPreis = new TextField("Preis pro Artikel:");
final TextField tfAnzahl = new TextField("Anzahl der Artikel:");
final Button bErstellen = new Button("Erstellen", FontAwesome.CHECK);
final Button bAbbrechen = new Button("Abbrechen", FontAwesome.STOP_CIRCLE);
final DateField dfVon = new DateField("Von:");
dfVon.setEnabled(false);
final DateField dfBis = new DateField("Bis:");
dfBis.setEnabled(false);
final NativeSelect nsModul = new NativeSelect("Modul:");
// Artikel Bild Upload Area
......@@ -152,8 +155,8 @@ public class ArtikelerstellungsView extends TemplateView implements View {
taBeschreibung.setMaxLength(250);
taBeschreibung.setSizeFull();
nsZustand.addItems("Neu", "Gebraucht");
nsZustand.setNullSelectionAllowed(false);
// nsZustand.addItems("Neu", "Gebraucht");
// nsZustand.setNullSelectionAllowed(false);
nsKategorie.addItems("Dienstleistung", "Multimedia");
nsKategorie.setNullSelectionAllowed(false);
......@@ -179,7 +182,7 @@ public class ArtikelerstellungsView extends TemplateView implements View {
Panel panel = new Panel("Artikel Erstellung");
panel.setSizeUndefined();
FormLayout flArtikel = new FormLayout(layoutUpload, tfName, taBeschreibung, lMaxLength, hKriterien, tfAnzahl, nsZustand, hVerfuegbarkeit, tfPreis, hKommand);
FormLayout flArtikel = new FormLayout(layoutUpload, tfName, taBeschreibung, lMaxLength, hKriterien, tfAnzahl, hVerfuegbarkeit, tfPreis, hKommand);
flArtikel.setMargin(true);
panel.setContent(flArtikel);
......@@ -238,6 +241,19 @@ public class ArtikelerstellungsView extends TemplateView implements View {
}
}
});
nsKategorie.addValueChangeListener((Property.ValueChangeEvent event) -> {
if (nsKategorie.getValue().toString().equals("Dienstleistung")) {
dfVon.setEnabled(true);
dfBis.setEnabled(true);
} else {
dfVon.setEnabled(false);
dfBis.setEnabled(false);
}
});
bAbbrechen.addClickListener(e
-> UI.getCurrent().getNavigator().navigateTo(Views.WELCOME));
super.setUpFooterAndHeader(panel);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment