This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a4j:commandLink action not working in rich:datatable

 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to put <a4j:commandLink> in <rich:datatable> but it was not working. None of its action or actionListener were getting called. After wasting a lot of time and trying a lot I found that the value{Collection} used for dataTable has to be in session scoped bean. If it is in request scoped bean then the action is not getting executed.

Can someone help me to understand this strange behavior?

Thanks in advance.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17624
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know about not getting executed, but execution can definitely fail.

Request-scope beans have very short lived. They only exist for a single request - for example, the one that presented the datatable.

Unfortunately, when you are attempting to select a row in a datatable for further processing, that requires a second request. Since the original request was destroyed, a new request bean gets constructed. But it doesn't have the row context that the previous request did. That's why you need a session-scope object. So it will survive over multiple requests and maintain the datamodel and current row indicators.
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim. It was a nice explanation.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic