what I do is: have a hidden html-form in my html page:
<div id="hiddenLoginDiv" style="display:none" >
<form id="hiddenLoginForm" method="post" action="dummy.html"
onsubmit="javascript:return false;">
<input id="username" name="username" type="text" size="20"
maxlength="100" />
<input id="password" name="password" type="password" size="20"
maxlength="100" />
<input id="hiddenLoginFormSubmitButton" type="submit" />
</form>
</div>
in my entry-point I simply read those values and set them into my gwt-
text and gwt-password fields.
if the html values are empty, my gwt-fields will also be empty (this
is always the case when the user enters the site for the first time).
when the user then clicks my login-button:
* I copy the values from my gwt-fields back to the html-fields in the
hidden form
* then I call click on the hidden form's submit button (which will
NOT submit the form, see onsubmit())
this triggers the browsers passwordmanager
* then I proceed with my own login-routine on the server
NOTES:
* I am not sure, that this will work in all browsers password
managers - I think some browsers require the form to really be
submitted
anyway: it works well in firefox 3
*
http://code.google.com/docreader/#p=google-web-toolkit-incubator&s=google-web-toolkit-incubator&t=LoginSecurityFAQ
* to trigger the form submit:
/**
* will trigger the submit action of the dummy login form for
password managers
* the form will not be submitted, because the onSubmit function will
always return false.
* note: calling form.submit() instead of calling button.click() will
not call the onSubmit
* function but submit the form immediately.
*/
public static native void submitHiddenLoginForm() /*-{
$doc.getElementById('hiddenLoginFormSubmitButton').click();
}-*/;