-
1. Re: Difference: Collection with and without @DataModel?
swd847 Aug 27, 2009 1:06 PM (in response to allforjava.allforjava.aol.in)Do not use @Datamodel if you can possibly avoid it (i.e. if you are using rich:dataTable instead of h:dataTable), with richfaces it is simply not nessesary and adds extra processing overhead.
-
2. Re: Difference: Collection with and without @DataModel?
allforjava.allforjava.aol.in Aug 27, 2009 3:49 PM (in response to allforjava.allforjava.aol.in)Thank you Stuart, for speedy reply!
1.a Can I get the details how the use of @DataModel adds overhead with rich:dataTable?
1.b And in which scenerios can I use it?2. One more query, is it good practise to forward search and pagination status as 'page parameters' towards view with list/colletion?
Or any way only the search/pagination conditons can be saved in conversation instead of complete resultList?
-
3. Re: Difference: Collection with and without @DataModel?
asookazian Aug 27, 2009 7:34 PM (in response to allforjava.allforjava.aol.in)This is the first time I've heard that @DataModel adds overhead significant enough to say
don't use it
. It basically wraps your java.util.List or similar collection into ListDataModel which is useful for clickable dataTables. You can then inject the clicked record using @DataModelSelection. I've used it very often.As an alternative, you can use @Out or simply a getter method to access your List in your JSF page, and then you can pass the current rowIndex using JBoss EL as follows:
<h:inputText value="foo" action="#{myComponent.bar(baz.getRowIndex())}"/>
where baz is the value of your dataTable (i.e. the actual List).
-
4. Re: Difference: Collection with and without @DataModel?
allforjava.allforjava.aol.in Aug 28, 2009 7:23 AM (in response to allforjava.allforjava.aol.in)I'm really confused! I guess the Seam Team can clarify and guide towards this situation.
And please clarify/response-to main queries:
1. Any thumb rule how to determine the situations where @out or @DataModel can be used?
2. Is it good practise to forward search and pagination status as 'page parameters' towards view with list/colletion?
3. Any way where only the search/pagination conditons can be saved in conversation instead of complete resultList?
This will be helpful for me and other.