1

I'm a french computer science student, and I have a small JSF project for school. I'm a little bit noob and I try to pass data between 2 view but I fail.

First I have a view which list all my customers, in a datatable. In this datatable I have a link to show a customer profile. I use, for both view, a CustomerController which is a requestscoped managedbean.

Before I use a global sessionscoped controller but I think it's not the good way to pass data.

Then I found this article : JSF Best Practices, it recommend to use to pass object between views. I didn't manage to make it work.

And finally I found also this question from Stackoverflow : f:setPropertyActionListener sets null value instead of intended value which use

My question is : what is the best ways to pass data ? And how manage it ?

Community
  • 1
  • 1
NotGrm
  • 111
  • 1
  • 8

1 Answers1

5

It's explained in this article from BalusC. You need to send id of your selected item to second view through h:link and catch it then with <f:event>.

Petr Mensik
  • 26,874
  • 17
  • 90
  • 115