Variable param names and multiple instances of Loginform on the same page.

Version 6.2 brings along the new Loginform which generates HTML rather ajaxic javascript. This as doc says is to allow browser autofills to easily recognise prior-used fields to work. Right?

However, I am discovering there are two short-comings that would elevate Loginform from trivial usage to professional usage.

  • cannot have more than one Loginform on the same page.
  • cannot have parameters other than username and password.

Why I wish to have more than one Loginform:

  • I would like to have three tabs, each with a choice of logging into a different respective application.
  • Or, I have four tabs, first for direct login, second for using openid login and third for forgotten password and fourth creating new user.

And then I might not wish to use the param name username. I would like to use the param name openid or userid.

I tried over-riding getLoginHTML and getFilename, I still encounter exception due to Loginform encountering ambiguous sources of parameters. I thought of over-riding urihandler in Loginform but it’s private.

And BTW, notice the less than acceptable spelling in urihandler? “handeled” rather than “handled” and “responce” vs “response”. Hopefully with my arms folded, my users won’t get to see any non-commonly acceptable spelling.

private URIHandler uriHandler = new URIHandler() {
    private static final long serialVersionUID = 1L;
    private final String responce = "<html><body>Login form handeled."

Anyway, am I right or there are ways to tweak Loginform to allow more than one Loginform on a page and to allow parameters other than “username” and “password”?

Hi!

Well I haven’t thought one would add two LoginForm on a page at the same time. The parameter handler in LoginForm does not support it, but it should be quite easy to build support for it. The parameter handler currently checks for “username” parameter and only handles form in that case. That could be changed to some instance specific identifier that would be a hidden field in the html page.

As for the spelling issues your pointed, they will not be visible to end users. If they disturb you too much, please fix them and post a patch to http://dev.vaadin.com/ . I can review and commit multiple login forms on a page patch too, if you end up implementing one.

It is good to point out every now and then that Vaadin is an open source project. Of course if you are our support client, post a support ticket and I’ll fix your issues today.

cheers,
matti