Skip to content
Snippets Groups Projects
Commit 1e730d95 authored by JanPhilipp's avatar JanPhilipp
Browse files

fertige RegistrierungsView

parent 53a0786c
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ public class RegistrationControl { ...@@ -36,6 +36,7 @@ public class RegistrationControl {
email = data[2]; email = data[2];
password = data[4]; password = data[4];
if (!nameValidator(surname)) { if (!nameValidator(surname)) {
return false; return false;
} }
......
...@@ -9,15 +9,17 @@ import com.vaadin.navigator.View; ...@@ -9,15 +9,17 @@ import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener; import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.server.FontAwesome; import com.vaadin.server.FontAwesome;
import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button; import com.vaadin.ui.Button;
import com.vaadin.ui.DateField;
import com.vaadin.ui.FormLayout; import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label; import com.vaadin.ui.Label;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Panel; import com.vaadin.ui.Panel;
import com.vaadin.ui.PasswordField; import com.vaadin.ui.PasswordField;
import com.vaadin.ui.TextField; import com.vaadin.ui.TextField;
import com.vaadin.ui.UI; import com.vaadin.ui.UI;
import java.util.Date;
import org.s4s.dao.impl.RegistrationControl; import org.s4s.dao.impl.RegistrationControl;
import org.s4s.services.util.Views; import org.s4s.services.util.Views;
...@@ -44,6 +46,12 @@ public class RegistrierungView extends TemplateView implements View { ...@@ -44,6 +46,12 @@ public class RegistrierungView extends TemplateView implements View {
panel.setSizeUndefined(); panel.setSizeUndefined();
FormLayout content = new FormLayout(); FormLayout content = new FormLayout();
TextField benutzername = new TextField("Benutzername");
content.addComponent(benutzername);
DateField bday = new DateField("Geburtstag");
content.addComponent(bday);
TextField nachnameTxt = new TextField("Nachname:"); TextField nachnameTxt = new TextField("Nachname:");
nachnameTxt.setIcon(FontAwesome.USER); nachnameTxt.setIcon(FontAwesome.USER);
...@@ -53,6 +61,14 @@ public class RegistrierungView extends TemplateView implements View { ...@@ -53,6 +61,14 @@ public class RegistrierungView extends TemplateView implements View {
TextField vornameTxt = new TextField("Vorname:"); TextField vornameTxt = new TextField("Vorname:");
vornameTxt.setIcon(FontAwesome.ANDROID); vornameTxt.setIcon(FontAwesome.ANDROID);
content.addComponent(vornameTxt); content.addComponent(vornameTxt);
NativeSelect fachbereich = new NativeSelect("Fachbereich");
fachbereich.addItems("Student", "Hivi", "Prof");
fachbereich.setNullSelectionAllowed(false);
content.addComponent(fachbereich);
TextField emailTxt = new TextField("E-Mail:"); TextField emailTxt = new TextField("E-Mail:");
emailTxt.setIcon(FontAwesome.MAIL_FORWARD); emailTxt.setIcon(FontAwesome.MAIL_FORWARD);
...@@ -69,6 +85,8 @@ public class RegistrierungView extends TemplateView implements View { ...@@ -69,6 +85,8 @@ public class RegistrierungView extends TemplateView implements View {
PasswordField passwortTxtWdh = new PasswordField("Passwort wiederholen:"); PasswordField passwortTxtWdh = new PasswordField("Passwort wiederholen:");
passwortTxtWdh.setIcon(FontAwesome.KEY); passwortTxtWdh.setIcon(FontAwesome.KEY);
content.addComponent(passwortTxtWdh); content.addComponent(passwortTxtWdh);
HorizontalLayout buttons = new HorizontalLayout(); HorizontalLayout buttons = new HorizontalLayout();
Button abbruch = new Button("Abbruch"); Button abbruch = new Button("Abbruch");
...@@ -90,25 +108,29 @@ public class RegistrierungView extends TemplateView implements View { ...@@ -90,25 +108,29 @@ public class RegistrierungView extends TemplateView implements View {
bestätigen.addClickListener( e -> { bestätigen.addClickListener( e -> {
String benutzer = benutzername.getValue();
String nachname = nachnameTxt.getValue(); String nachname = nachnameTxt.getValue();
String vorname = vornameTxt.getValue(); String vorname = vornameTxt.getValue();
Date gebDate = bday.getValue();
String fBereich = (String) fachbereich.getValue();
String email = emailTxt.getValue(); String email = emailTxt.getValue();
String emailwdh = emailTxtWdh.getValue(); String emailwdh = emailTxtWdh.getValue();
String passwort = passwortTxt.getValue(); String passwort = passwortTxt.getValue();
String passwortWdh = passwortTxtWdh.getValue(); String passwortWdh = passwortTxtWdh.getValue();
UI.getCurrent().getNavigator().navigateTo(Views.REGISTRIERUNGSBESTAETIGUNG); UI.getCurrent().getNavigator().navigateTo(Views.REGISTRIERUNGSBESTAETIGUNG);
// RegistrierungControl.Methode(Parameter);
//Anbindungstestblock. svolle2s //Anbindungstestblock. svolle2s
RegistrationControl.init(new String[]{nachname, vorname, email, emailwdh, passwort, passwortWdh, benutzer,}); // diverse Daten fehlen siehe bday fachbereich
RegistrationControl.init(new String[]{nachname, vorname, email, emailwdh, passwort, passwortWdh});
System.out.println(benutzer);
System.out.println(nachname); System.out.println(nachname);
System.out.println(vorname); System.out.println(vorname);
System.out.println(gebDate);
System.out.println(email); System.out.println(email);
System.out.println(emailwdh); System.out.println(emailwdh);
System.out.println(passwort); System.out.println(passwort);
System.out.println(passwortWdh); System.out.println(passwortWdh);
System.out.println(fBereich);
// Weiterleitung auf Bestätigunsseite // Weiterleitung auf Bestätigunsseite
......
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