aspose file tools*
The moose likes JSF and the fly likes <h:commandLink> is not able to invoke backing bean method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "<h:commandLink> is not able to invoke backing bean method" Watch "<h:commandLink> is not able to invoke backing bean method" New topic
Author

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

Pawan Komaram
Ranch Hand

Joined: Dec 08, 2009
Posts: 91
hi

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


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Pawan Komaram
Ranch Hand

Joined: Dec 08, 2009
Posts: 91
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: <h:commandLink> is not able to invoke backing bean method