Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

<h:commandLink> is not able to invoke backing bean method

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

The <h:commandLink> inside the <h:dataTable> is not able to invoke the backing bean method. Can Anybody suggest the solution?


 
Saloon Keeper
Posts: 26065
186
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
A number of things can cause this. The first, and most obvious would be if you didn't have a "public String showProfile()" method in the backing bean.

The second most common reason would be if you had form inputs that failed to validate, but I don't see any input elements in your example, so in theory that isn't it.

It's often helpful to put a "h:messages" tag with the global option set on the page.
 
Pawan Komaram
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim!!!


I found the solution for this issue.....As I have used the <h:commandLink> inside a <h:dataTable> tag, whenever I click on the link, it tries to check the list variable of my backing bean whether it has the data or not, as my backing bean's scope is request, it couldn't take the list data to subsequent request, hence causing the problem. So the list variable must be initialized in the constructor, so that it can call the backing bean method. It happens when we use the commandLink inside a dataTable or any other looping tag.

This is actually a defect in jsf 1.2, they have fixed it in the jsf 2.0
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic