1

I have a login page containing a gwt bootstrap text box ,password text box and submit button

<g:VerticalPanel height="400px" width="50%">
                <b:WellForm  height="400px" ui:field="loginPanel">


                    <g:VerticalPanel horizontalAlignment="ALIGN_CENTER"
                        width="100%">
                        <b:FormLabel ui:field="emailErrorLabel" visible="false">
                            <font color="red">
                                <i>&nbsp;Please enter your login name</i>
                            </font>
                        </b:FormLabel>
                        <b:TextBox  alternateSize="LARGE" b:id="Email"
                            ui:field="Email" placeholder="E-mail"  width="335px"
                            height="30px" />
                    </g:VerticalPanel>


                    <g:VerticalPanel horizontalAlignment="ALIGN_CENTER" width="100%">
                        <b:FormLabel ui:field="passwordErrorLabel" visible="false">
                            <font color="red">
                                <i>&nbsp; Please enter password</i>
                            </font>
                        </b:FormLabel>
                        <b:PasswordTextBox  width="335px"
                            alternateSize="LARGE" ui:field="password" placeholder="Password"
                            height="30px" />
                    </g:VerticalPanel>
                    <b:Button type="PRIMARY" ui:field="loginButton" icon="SIGNIN">Login</b:Button></b:Wellform>

im setting following properties

loginPanel.setMethod("POST");
    loginPanel.getElement().setPropertyString("autocomplete", "on");
    Email.getElement().setAttribute("type", "text");
    password.getElement().setAttribute("type", "password");

and on click of login i'm calling an rpc which does the loggin in . What property am i missing .how can i get the browser to prompt save password option.

enrybo
  • 1,787
  • 1
  • 12
  • 20
Ekata
  • 259
  • 2
  • 7
  • 21

1 Answers1

1

In order for a browser to detect a save-able password, you must have the following HTML:

<form>
    <input type="text" />
    <input type="password" />
</form>

Make sure your GWT code compiles into those elements in the browser. When that form does the "submit" action, the browser will ask to save the password. I think since you have a clickhandler to log in the user manually, instead of your form performing a POST, the browser doesn't realize it is a login.

Also, I believe you don't need this:

password.getElement().setAttribute("type", "password");

because <b:PasswordTextBox already compiles into <input type="password" />. It is probably also unnecessary for the "Email" field, but I'm not sure.

enrybo
  • 1,787
  • 1
  • 12
  • 20
Churro
  • 4,166
  • 3
  • 25
  • 26