Permalink
Browse files

fixed columns in login form, added some dummy buttons for logedin use…

…r and added message for non-existin user or password
  • Loading branch information...
1 parent 2efe119 commit d7c2934c2a0bc24163a4f4807a6826bbdfe9459d @pkremens pkremens committed Jun 11, 2012
@@ -34,6 +34,11 @@ public void login() throws Exception {
this.currentUser = user;
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage("Welcome, " + currentUser.getName()));
+ } else {
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(
+ "Non existing user, or passoword or both :)"));
}
}
@@ -9,8 +9,8 @@
<h:messages />
<h:form id="loginForm">
- <h:panelGrid columns="2" rendered="#{!login.loggedIn}">
- <h:outputLabel for="email" value="Email:"/>
+ <h:panelGrid columns="3" rendered="#{!login.loggedIn}">
+ <h:outputLabel for="email" value="Email: "/>
<h:inputText id="email" value="#{credentials.email}" />
<h:message for="email" errorClass="invalid"/>
@@ -23,9 +23,17 @@
action="#{login.login}" rendered="#{!login.loggedIn}" />
<h:commandButton id="logout" value="Logout"
action="#{login.logout}" rendered="#{login.loggedIn}" />
+ <h:commandButton id="action1" value="Action1"
+ action="#{login.logout}" rendered="#{login.loggedIn}" />
+ <h:commandButton id="action2" value="Action2"
+ action="#{login.logout}" rendered="#{login.loggedIn}" />
+ <h:commandButton id="action3" value="Action3"
+ action="#{login.logout}" rendered="#{login.loggedIn}" />
</h:form>
<!-- <h:link outcome="/users.xhtml">View users</h:link> -->
+
+
<div>
<p>You have successfully deployed a Java EE 6 web application.</p>
<h3>Your application can run on:</h3>

0 comments on commit d7c2934

Please sign in to comment.