File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes problems with a commandLink inside a rich:datagrid Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "problems with a commandLink inside a rich:datagrid" Watch "problems with a commandLink inside a rich:datagrid" New topic
Author

problems with a commandLink inside a rich:datagrid

Julio Ayala
Greenhorn

Joined: Jun 03, 2011
Posts: 15

Hello,

I'm trying to create a photobook using a rich:datagrid. I have some pictures and I want to show them in rows and columns. When the user clicks on an item, the site should show its details. Actually, I display all the items, but unfortunately I am not able to execute the action "showDetails" in the backing bean:



myBean is my baking bean and elem is a model element. I want the commandLink sets the property itemIdDetails of the backing bean with the value of itemId.

When I debug, the setter receives a null value, and the action "showDetails" is never executed:



And my faces-config:



Please let me know if you need more information. Your ideas and comments will be much appreciated. Thank you in advance.



Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Is your #{elem.itemId} a String?


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Julio Ayala
Greenhorn

Joined: Jun 03, 2011
Posts: 15

Hello Hebert,

Yes, it is. It was a good idea, but the problem is when we use the richd:datagrid and the commandLink together. Just to test I have replaced the commandLink for another much simple, with fixed values and the result is the same.



After that, just to test if the commandLink was good, I wrote it outside the datagrid, like this one, with a fixed id, and it works perfectly! So for an unknown reason we cannot use a commandLink in a datagrid.

Thank you anyway, please let me know if you have any others ideas.

Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

You could also try with ajax.

Using the f:ajax or the a4j:region (i guess).
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16303
    
  21

commandLinks and commandButtons work just fine in a RichFaces dataGrid. Or, for that matter, the core JSF dataGrid. I do it all the time.

On the other hand, in probably 7-8 years of working with JSF, I've never had to use a propertyActionListener, and I'm too lazy to RTFM. But I wouldn't be surprised to learn that it was overriding the "action=" attribute on the commandLink.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problems with a commandLink inside a rich:datagrid