• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

commandlink not working

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<h:panelGrid columns="3" styleClass="loginSignup" rendered="#{member.verify}">
<h:commandLink value="login" action="login"/> <h:outputText value="/"/><h:commandLink value="Sign up" action="signup"/>
</h:panelGrid>
<h:panelGrid styleClass="loginSignup" rendered="#{not member.verify}">
<h:commandLink value="Logout" immediate="true" action="#{member.validateLogout()}"/>
</h:panelGrid>


public String validateLogout(){
return "failure";
}


<h:commandLink value="Logout" immediate="true" action="#{member.validateLogout()}"/> <- tis statement is not working!!anyone can help?
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First a couple of suggestions from our FAQ:

ItDoesntWorkIsUseless
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?
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 "()".
 
reply
    Bookmark Topic Watch Topic
  • New Topic