basic ListView question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

basic ListView question

karthikg
I'm want to be able to supply the ListView with a IModel that tells it how to get to the list. I'm not in a position to supply the List at the time of construction. The ListView needs to fetch it while rendering. So i supplied a Model configured with the "List source" with its getObject(Component) call overriden (where I fetch the list ). Ofcourse it works just fine!
My question is - Is this an acceptable way of using a Model / is there a better delegation model built in that I can use to do such things ? 
 
thanks,
karthik
 
Reply | Threaded
Open this post in threaded view
|

Re: basic ListView question

Igor Vaynberg-2
this is the right approach. this is exactly why the listview either takes a collection instance or an imodel instance instead.

-Igor


On 1/3/06, karthik Guru <[hidden email]> wrote:
I'm want to be able to supply the ListView with a IModel that tells it how to get to the list. I'm not in a position to supply the List at the time of construction. The ListView needs to fetch it while rendering. So i supplied a Model configured with the "List source" with its getObject(Component) call overriden (where I fetch the list ). Ofcourse it works just fine!
My question is - Is this an acceptable way of using a Model / is there a better delegation model built in that I can use to do such things ? 
 
thanks,
karthik