Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problems with a commandLink inside a rich:datagrid

 
Julio Ayala
Greenhorn
Posts: 15
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 754
Eclipse IDE Java
 
Julio Ayala
Greenhorn
Posts: 15
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also try with ajax.

Using the f:ajax or the a4j:region (i guess).
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18157
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic