click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Schellink (JIRA)" <>
Subject [jira] Resolved: (CLK-640) Add DataProvider for Table and Select controls
Date Tue, 06 Apr 2010 10:13:33 GMT


Bob Schellink resolved CLK-640.

    Resolution: Fixed

fixed in trunk

> Add DataProvider for Table and Select controls
> ----------------------------------------------
>                 Key: CLK-640
>                 URL:
>             Project: Click
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 2.1.0
>            Reporter: Malcolm Edgar
>            Assignee: Malcolm Edgar
>             Fix For: 2.2.0
>         Attachments:
> One reoccurring problem we see with people using Click is the inappropriate use of the
Page#onRender() method. Typically its used to set data into the Table control, but then people
will often use this Page method to set data in other controls such as the FormTable or Select
controls, which breaks their usage contract.
> What I would like to see is that data controls such as the Table, Select and FormTable
are able to load the data when they need it, rather than having to rely on the developer injecting
the data at the correct point in the pages life cycle.  This will provide an improve programming
model where developers simply create their controls in the Page constructor or onInit() method,
configure data providers when necessary, and write up control event handlers to the appropriate
> The DataProvider interface would be very simple:
> public interface DataProvider {
>      public List getData();
> }
> Developers would then implement this interface when creating their controls:
> Table table = new Table();
> table.addColumn()
> ...
> table.setDataProvider(new DataProvider() {
>     public List getData() {
>          return customerDao.getCustomerList();
>     }
> });

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message