I created an VaadIn Design with the Visual Designerfrom Vaadin Labs
Its basic an login panel
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" name="design-properties" content="{"RULERS_VISIBLE":true,"GUIDELINES_VISIBLE":false,"SNAP_TO_OBJECTS":true,"SNAP_TO_GRID":true,"SNAPPING_DISTANCE":10.0,"PAPER_WIDTH":1440,"PAPER_HEIGHT":900,"JAVA_SOURCES_ROOT":"src","THEME":"sws_7_2"}">
</head>
<body>
<v-panel caption="Login" width="40%" height="40%" _id="login">
<v-vertical-layout spacing="true" size-full="true" margin="">
<v-horizontal-layout spacing="true" width-full="true">
<v-label size-auto="true" plain-text="" :middle="" :right="" _id="lblLoginName">
Login naam :
</v-label>
<v-text-field :middle="" _id="txtLoginName"></v-text-field>
</v-horizontal-layout>
<v-horizontal-layout spacing="true" width-full="true">
<v-label size-auto="true" plain-text="" :middle="" :right="" _id="lblPassword">
Paswoord :
</v-label>
<v-text-field :middle="" _id="txtPassword"></v-text-field>
</v-horizontal-layout>
<v-horizontal-layout spacing="true" width-full="true">
<v-button plain-text="" :middle="" :right="" _id="btnLogin">
Login
</v-button>
<v-button plain-text="" :middle="" _id="btnCancel">
Annuleren
</v-button>
</v-horizontal-layout>
<v-horizontal-layout spacing="true" width-full="true">
<v-button plain-text="" :middle="" :center="" _id="btnLoginPasswordForgotten">
Login / paswoord vergeten?
</v-button>
</v-horizontal-layout>
<v-horizontal-layout width-full="true">
<v-label width="6px" plain-text="" :middle="" :center="" _id="lblError"></v-label>
</v-horizontal-layout>
</v-vertical-layout>
</v-panel>
</body>
</html>
When I call the loginscreen (code below) I see it but I can't do anything with it. The ClickListner isn't working, I can't even change a label value or something ...
public class Login extends LoginDesign implements Button.ClickListener {
private static final long serialVersionUID = 1L;
private UI mainUI;
private ClickListener listner = this;
public Panel createLoginPanel(UI mainUI) {
this.mainUI = mainUI;
LoginDesign login = new LoginDesign();
btnLogin.addClickListener(listner);
lblError.setValue("Problem");
System.out.println(lblError.getValue());
return login;
}....
I see the changed value of the lblError in the console, but not on the screen ... ?
Normally you create your buttons and you add the caption and the listener. Here I need to add the listener seperatly ... ?!
I'm doing something wrong ... any suggestions!. Thx!
Solved it.
I took an instance of the generated file but you need to use the extended class .. .
public class Login extends LoginDesign implements Button.ClickListener {
private static final long serialVersionUID = 1L;
private UI mainUI;
private ClickListener listner = this;
public Panel createLoginPanel(UI mainUI) {
this.mainUI = mainUI;
Login login = new Login();
btnLogin.addClickListener(listner);
lblError.setValue("Problem");
System.out.println(lblError.getValue());
return login;
}....
Solved it