Yes,
you could do your own parameter passing. It's just that JSF offers the
DataModel abstraction such that, when the user clicks on your link,
your program just has to ask DataModel for rowIndex to locate the row that
was selected. It's designed to simplify your coding.
In the
applications I've worked on, we very rarely have to explicitly pass request
parameters. Pretty much everything is in the bean.
-
Brendan
-----Original Message-----On 8/29/05, Kevin Galligan <[EMAIL PROTECTED]> wrote:
From: Rick Reumann [mailto:[EMAIL PROTECTED]
Sent: Monday, August 29, 2005 2:09 PM
To: MyFaces Discussion
Subject: Re: Concerning DataModel usage plus overhead?RickIf you use the standard dataTable, you have to
keep your values in session between the time you show the list and when
they click on the value. If you get the values from the db each time,
you open the possibility that the index will have changed, and the
selected value will be incorrect. If you keep the values in session,
its keeping a lot of data around, and you need to explicitly code a refresh.
To me the above is just really goofy. Unless, there are security constraints to me it makes sense to get the item you want back based on some key. Maybe for example you are looking at a list of care models on a page, then you want to see the details of the car. It makes most sense to me to click on the car model passing the id of the model you want, you look up the model and you pass it back. When you need the list of cars back, get a fresh set from the backend. If you need caching, cache at the persistence layer.
I don't see the advantage of saving the state of a DataModel, but I'm new to all of this, so maybe I'll see the light at some point.
--