views:

1027

answers:

5

I using GWT and have created a login form. I've tried all sorts of ways to get IE7 to prompt to remember the login info but with no success. I thought that maybe this would have worked (but it didn't):

    TextBox submit = new TextBox();
    submit.getElement().setAttribute("type", "submit");

Any ideas?

A: 

I don't know GWT, but you might need to somehow set an attribute on the form tag -
autocomplete="on", which has worked for me on a few occasions.

More info here: http://msdn.microsoft.com/en-us/library/ms533486.aspx

seanb
A: 

If the password textbox is of type password the bowser should prompt for saving the password... Make sure the Prompt me to save password in Tools >internet options > content > auto-complete (settings) is checked.

sarego
That's not much use on anybody else's computer though....
seanb
:) yeah u r rite
sarego
A: 

One thing I've been able to do that works is wrapping static elements (elements in the actual HTML page, not ones created via Java).

+2  A: 

You can simply assign values:

private TextBox mName = new TextBox();
private PasswordTextBox mPassword = new PasswordTextBox();

mName.setText("username");
mPassword.setText("password");

In your case I would store the values in cookies, and read them out on startup.

public static String getLastLoginName()
{   
    return Cookies.getCookie(LAST_LOGIN_COOKIE);
}

public static void setLastLoginName(String userName)
{
    Cookies.setCookie(LAST_LOGIN_COOKIE, userName);
}
Drejc
A: 

Both sarego and Drejc hinted at the possible solution:

I'm not sure but you may need a PasswordTextBox to trigger IE's "remember this password" features. Also, IE may be getting confused that the elements are bare and not within a FORM element.

I develop extensively with GWT and we've implemented our own "remember me" feature using cookies, it tends to me more reliable and predictable. And your app can then be in control of removing the remembered password (ie, the corresponding "forget me" feature).

Mark Renouf