File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes commandlink not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "commandlink not working" Watch "commandlink not working" New topic

commandlink not working

kahkean chor
Ranch Hand

Joined: Jan 26, 2013
Posts: 67
<h:panelGrid columns="3" styleClass="loginSignup" rendered="#{member.verify}">
<h:commandLink value="login" action="login"/> <hutputText value="/"/><h:commandLink value="Sign up" action="signup"/>
<h:panelGrid styleClass="loginSignup" rendered="#{not member.verify}">
<h:commandLink value="Logout" immediate="true" action="#{member.validateLogout()}"/>

public String validateLogout(){
return "failure";

<h:commandLink value="Logout" immediate="true" action="#{member.validateLogout()}"/> <- tis statement is not working!!anyone can help?
Greg Charles

Joined: Oct 01, 2001
Posts: 2962

First a couple of suggestions from our FAQ:

UseCodeTags (XML code works well for JSF)

Is that validateLogout() method part of a managed bean named "member"? Does the method not get called? Does it get called, but the navigation doesn't go where you expect?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17257

Your action statement isn't working because the action isn't a statement. It's an EL expression that references a backing bean action method, not calls it directly.

Lose the "()".

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: commandlink not working
It's not a secret anymore!