• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

problems with a commandLink inside a rich:datagrid

 
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.



 
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).
 
Saloon Keeper
Posts: 22503
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic