Merci Thomas
Unfortunately I only got this working in Fire Fox again.
Results on Vista:
FireFox shows Window.alert and offers to store username and password
Chrome 2 shows Window.alert
Safari 4 shows Window.alert
IE8 does not even show Window.alert
This is my test code:
package bagarsjon.client;
import com.google.gwt.dom.client.Document;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.FormPanel;
public class LoginDialog extends DialogBox {
public LoginDialog() {
FormPanel form = FormPanel.wrap(Document.get().getElementById
("login"), false);
form.setAction("javascript:__gwt_login()");
injectLoginFunction();
setText("Logga in för att registrera vattenförbrukning");
setWidget(form);
setPopupPosition(200,10);
}
public static void authenticate() {
Window.alert("success");
}
private static native void injectLoginFunction()
/*-{
$wnd.__gwt_login = @bagarsjon.client.LoginDialog::authenticate
();
}-*/;
}
part of html-doc
<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1'
style="position:absolute;width:0;height:0;border:0"></iframe>
<!-- hidden login form that triggers password autocomplete. See code
in LoginDialog.java -->
<div id="hiddenLoginDiv" style="display:none" >
<FORM id="login">
<TABLE>
<TBODY>
<TR>
<TD><DIV
class=gwt-Label>Husnummer</DIV></TD>
<TD><DIV
class=gwt-Label>Lösenord</DIV></TD>
</TR>
<TR>
<TD><INPUT id="" style="WIDTH:
40px" class=gwt-TextBox
tabIndex=0></TD>
<TD><INPUT id=""
class=gwt-PasswordTextBox tabIndex=0 value=""
type=password AUTOCOMPLETE="on"></TD>
<TD><BUTTON id=""
class=gwt-Button tabIndex=0>login</BUTTON></
TD>
<TD><DIV style="WIDTH: 9em"
class=gwt-Hyperlink><A>skicka mitt
lösenord</A></DIV></TD>
</TR>
<TR>
<TD colSpan=4><SPAN
class=gwt-CheckBox><INPUT id="rememberme"
tabIndex=0 CHECKED type=checkbox><LABEL for=gwt-uid-1>Kom ihåg mig</
LABEL></SPAN></TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</div>
</body>
</html>
I have put a lot of efforts into this and it seems only possible to
get it working using a plain and simple login html page and a
dedicated servlet.
/johan
On Jun 23, 11:32 am, Thomas Broyer <[email protected]> wrote:
> On 23 juin, 11:24, Johan Lundberg <[email protected]> wrote:
>
> > I tried to implement a solution that would trigger the browsers
> > function to ask for "remember this username and password" by the built
> > in AUTOCOMPLETE feature. I found the post below but only got it
> > working in FireFox. Does anyone have a different solution that works
> > in most browsers?
>
> Have a look
> athttp://groups.google.fr/group/Google-Web-Toolkit/msg/164941ca1bafbae5
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---