-
1. Re: getter problem
skanky78 Oct 21, 2007 8:08 AM (in response to skanky78)hi,
i thougt one of you could maybe give me a hint because it is a common problem. is it possible to solve this issue without using @dataModel?
thanx,
sven -
2. Re: getter problem
pmuir Oct 23, 2007 7:43 AM (in response to skanky78)@Factory/@Create. Or, better yet, use an EntityQuery which supports paging data natively.
-
3. Re: getter problem
skanky78 Oct 23, 2007 5:50 PM (in response to skanky78)thank you pete, now i'm using the @factory annotation.
for pagination i'm using rich:datascroller and a dataTable component-binding (as recommended in the doc: http://docs.jboss.com/seam/2.0.0.CR1/reference/en/html_single/#d0e5034)
@In(create = true)
// dataTable binding
protected Binding binding;
@Factory(scope=ScopeType.EVENT)
public DataModel getItems() {
// in this method i'm using the current dataTable index (dataTable.getFirst()) and pagesize (dateTable.getRows) to get the items for the selected page
}
<rich:dataTable id="dataTable" binding="#{binding.dataTable}" value="#{items}">
..
</rich:dataTable>
the problem with that is, that i need the current index of the datatable within the factory method to fetch the items for selected page. but at the time the factory method is executed (after restore view phase) the method binding.dataTable.getFirst() returns the old value because it isn't initialized yet.
how can i get the current index of the dataTable (if datascroller is used) so that i'm able to fetch the next page items in the factory method? any ideas?
cheers,
sven -
4. Re: getter problem
pmuir Oct 24, 2007 11:33 AM (in response to skanky78)I don't entirely understand why you are trying to do. Are you trying to lazy load data based on where the section of the datatable you are loading?
-
5. Re: getter problem
skanky78 Oct 24, 2007 6:59 PM (in response to skanky78)i only want to fetch those items which are shown on the current active page. therefore i need the actual index of the datatable. but by the time the factory method is executed the method binding.datatable.getFirst() always returns 0. my question is how can i get the current index of my datatable so that i can use it to build the query in the factory method.
thank you for your suppot,
sven
ps: i can't use an entityquery because i haven't an entitymanager at all. i'm building a webapp on top of a third party ecommerce plattform which provides its own api with a sql like qery language. -
6. Re: getter problem
skanky78 Oct 26, 2007 4:05 PM (in response to skanky78)there has to be a solution or at least a workaround for this issue..or am i doing something abnormal? how do you handle pagination (loading only those items which are currently needed for the view) with the datascroller component?
cheers,
sven -
7. Re: getter problem
skanky78 Nov 3, 2007 7:22 AM (in response to skanky78)anyone else using rich:datascroller with large datasets?