How are you getting your source data?
* Cayenne
* Hibernate
* JDBC

regards Malcolm Edgar

On Thu, Mar 4, 2010 at 7:32 PM, Bob Schellink <[email protected]> wrote:
> Hi Kristian,
>
> I just tested the large data demo and it seems to work correctly:
>
>    // Return count of 2
>    private int getCustomerCount() {
>        return 2;
>    }
>
>    // Return 2 hardcoded customers
>    private List<Customer> getCustomers(int from, int pageSize, String
> sortedColumn,
>        boolean ascending) {
>
>        List customers = new ArrayList();
>        Customer customer = new Customer();
>        customer.setName("test");
>        customers.add(customer);
>
>        customer = new Customer();
>        customer.setName("test");
>        customers.add(customer);
>        return customers;
>    }
>
> kind regards
>
> bob
>
>
> On 4/03/2010 06:30 PM, kristian_widjaja wrote:
>>
>> Hi all,
>>
>> I am currently developing a webapp using Click 2.1.0. Anyway, according to
>> my project reqs, there are pages that needs to display data in a
>> pagination
>> way. And i've had click examples "large dataset demo" implemented in my
>> project.
>>
>> So, when i didn't use "DataProvider" class as a data adapter, it works
>> fine
>> when the amount of retrieved data is less than the table's pageSize.
>>
>> The problem is, when i used the "DataProvider" to perform pagination and
>> the
>> amount of retrieved data is less than the table's pageSize, the
>> IndexOutOfBoundsException is thrown by the page when rendering the page.
>> For
>> example :
>>
>> <code>
>> public ProfilePage() {
>>        ...
>>
>>        table.setPageSize(10);
>>        table.setSortable(true);
>>        table.setSorted(true);
>>        ...
>> }
>>
>> @Override
>> public void onRender() {
>>        log.debug("# Rendering Profile Page...");
>>        if (hasPreservedState()) {
>>            DataProvider dataProvider = new DataProvider(table,
>> getMemberUsersRecordCount());
>>            table.setRowList(dataProvider);
>>
>>            List<MemberUsers>  memberUsersList = getMemberUsersList(); //
>> e.g. only
>> 5 records
>>            dataProvider.addAll(memberUsersList);
>>        }
>> }
>> </code>
>>
>> The method 'getMemberUsersRecordCount()' is returning value of '5', so
>> when
>> retrieving the data, method 'getMemberUsersList()' only returning 5
>> records.
>>
>> Is there anyone ever having the same problem? Or is there any posting from
>> another user?
>> Thanks.
>
>

Reply via email to