Login

UI Components for JSF
Post Reply
thomy
Posts: 22
Joined: 09 Oct 2009, 11:37

21 Oct 2009, 11:45

Hi there,

TouchFaces is nw working with Facelets and jsp =).

I tried to create a small login page. I want to show the Link to the menu only when the loggin is passed.

Login Method in Bean:

Code: Select all

public void login(){
		if(this.loginname.equals("1337") && this.password.equals("King")){
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("You're logged in"));
			this.loggedIn = true;
		}
	}
Link and Command Link in XHTML

Code: Select all

<!--Link Menu-->
                    <i:rowGroup id="Link" rendered="true">
                    	<p:commandLink actionListener="#{LoginValidator.login}" style="margin:0 10px;" styleClass="whiteButton" >Login </p:commandLink>
                        <i:rowItem value="Menu" view="menu" rendered="#{LoginValidator.loggedIn}" />
                    </i:rowGroup>
It does't work. The Link isn't displayed when i try to log in with the name 1337 and the pw: King

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests