LoginForm questions

Hello,all.

I’m new to Vaadin and web applications in general, but I like what I’ve been able to do with the framework so far. Very nice.

I have a few questions about the LoginForm class:

  • When I dispaly the form, it has the labels above the text areas. Is there a way to get it to display the labels to the left of the text areas?

  • There is no spacing between the bottom of the password text area and the button. Is there a way to get it to add a bit of space there?

  • Is there a way to provide alternate text for the labels – e.g. for internationalization, or is that built in somehow?

Thanks, Maury

Well, I think I’ve figured out what the answer to my questions is. I believe all three can be answered with the phrase “override getLoginHTML()” :slight_smile:

Yup, you got it :slight_smile:

If you are looking for a quick and dirty way to add some vertical spacing to the standard LoginForm then the following does the trick (using Vaadin 6.3.4):

[font=Courier New]

LoginForm loginForm = new LoginForm() {
@Override
public byte getLoginHTML() {
byte htmlBytes = super.getLoginHTML();
String htmlString = new String(htmlBytes);
htmlString = htmlString.replace(
“<input class=‘v-textfield’ style='display:block;”,
“<input class=‘v-textfield’ style='margin-bottom:10px; display:block;”);
return htmlString.getBytes();
}
};

[/font]

Regards,
Philip