GeeCON Prague 2014*
The moose likes JSF and the fly likes Login Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Login Problem" Watch "Login Problem" New topic
Author

Login Problem

Ramesh Etta
Ranch Hand

Joined: Sep 18, 2007
Posts: 46
Hi,

i had written a login page in jsf with fields UserName and Password.
Now i had two buttons named Login and Clear.
When i enter username and password values and press enter key nothing is happening. i mean the submit is not happening. but when i press the login button it is being submitted.

Now i want like after i enter password and press Enter button, the submit needs to happen.
Please help me in this matter.

here is the login page jsf code:

<h:form id="mainFrm" >
User Name:<h:inputText id="username" value="#{loginBean.userName}"
required="true" maxlength="30" />
Pasword: <h:inputSecret id="passwordd" value="#{loginBean.password}" required="true" maxlength="30" />
<h:commandButton action="#{loginBean.authenticateUser}"
value="Login" styleClass="button" />
<h:commandButton type="reset" value="Clear"
styleClass="button" />
</h:form>
Sanjay Chavan
Greenhorn

Joined: Nov 12, 2008
Posts: 11
Originally posted by Ramesh Etta:
Hi,

i had written a login page in jsf with fields UserName and Password.
Now i had two buttons named Login and Clear.
When i enter username and password values and press enter key nothing is happening. i mean the submit is not happening. but when i press the login button it is being submitted.

Now i want like after i enter password and press Enter button, the submit needs to happen.
Please help me in this matter.

here is the login page jsf code:

<h:form id="mainFrm" >
User Name:<h:inputText id="username" value="#{loginBean.userName}"
required="true" maxlength="30" />
Pasword: <h:inputSecret id="passwordd" value="#{loginBean.password}" required="true" maxlength="30" />
<h:commandButton action="#{loginBean.authenticateUser}"
value="Login" styleClass="button" />
<h:commandButton type="reset" value="Clear"
styleClass="button" />
</h:form>
Sanjay Chavan
Greenhorn

Joined: Nov 12, 2008
Posts: 11
Originally posted by Sanjay Chavan:
[QB][/QB]


I have tried with your code.
Its working fine on my system.
vikas bala
Greenhorn

Joined: Dec 26, 2006
Posts: 19
Hello Ramesh,
I also tried with your code and its working for me too.


Thanks
Vikas


hugs <br />Vikas
 
GeeCON Prague 2014
 
subject: Login Problem