You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martijn Dashorst <ma...@gmail.com> on 2007/05/20 14:08:28 UTC
[proposal] Make columns of repeaters List instead of IColumn[]
I have been working on a small Wicket application where I use the
datatable in a highly dynamic way: the columns can be added and
removed at runtime. This is working out really nicely with one caveat:
the columns are defined as arrays instead of lists.
In order to make this work I had to duplicate the datatable hierarchy
from the AbstractDataGrid (iirc) and reimplement the toolbars. This
was of course not too much work, but I think this is a valuable
addition to the repeaters package.
I'm not sure if it is a good idea to implement this change now, because of:
* the feature freeze
* the fact that in Java 1.4 the collections are not typesafe: List is
not List<IColumn>
The pros are:
* it makes the component dynamic in the way Wicket is intended to be
* it opens the ability to make really dynamic UI's
* it is dead sexy when you use Ajax to add and remove the columns
Is there a reason why the columns is implemented as an array instead
of a collection that I am not aware of?
Martijn
Re: [proposal] Make columns of repeaters List instead of IColumn[]
Posted by Igor Vaynberg <ig...@gmail.com>.
you need to use some trickery when adding/removing columns if you want this
thing to work in a form. see my recent change to datatable or one of its
parents where i changed refreshingview used to render columns to
repeatingview to make it work right in forms.
-igor
On 5/20/07, Martijn Dashorst <ma...@gmail.com> wrote:
>
> I have been working on a small Wicket application where I use the
> datatable in a highly dynamic way: the columns can be added and
> removed at runtime. This is working out really nicely with one caveat:
> the columns are defined as arrays instead of lists.
>
> In order to make this work I had to duplicate the datatable hierarchy
> from the AbstractDataGrid (iirc) and reimplement the toolbars. This
> was of course not too much work, but I think this is a valuable
> addition to the repeaters package.
>
> I'm not sure if it is a good idea to implement this change now, because
> of:
> * the feature freeze
> * the fact that in Java 1.4 the collections are not typesafe: List is
> not List<IColumn>
>
> The pros are:
> * it makes the component dynamic in the way Wicket is intended to be
> * it opens the ability to make really dynamic UI's
> * it is dead sexy when you use Ajax to add and remove the columns
>
> Is there a reason why the columns is implemented as an array instead
> of a collection that I am not aware of?
>
> Martijn
>
Re: [proposal] Make columns of repeaters List instead of IColumn[]
Posted by Matej Knopp <ma...@gmail.com>.
I'd like that. We can keep the oribinal contructor, can't we?
I'd also like isVisible on IColumn, but that might be too late to add.
-Matej
On 5/20/07, Martijn Dashorst <ma...@gmail.com> wrote:
> I have been working on a small Wicket application where I use the
> datatable in a highly dynamic way: the columns can be added and
> removed at runtime. This is working out really nicely with one caveat:
> the columns are defined as arrays instead of lists.
>
> In order to make this work I had to duplicate the datatable hierarchy
> from the AbstractDataGrid (iirc) and reimplement the toolbars. This
> was of course not too much work, but I think this is a valuable
> addition to the repeaters package.
>
> I'm not sure if it is a good idea to implement this change now, because of:
> * the feature freeze
> * the fact that in Java 1.4 the collections are not typesafe: List is
> not List<IColumn>
>
> The pros are:
> * it makes the component dynamic in the way Wicket is intended to be
> * it opens the ability to make really dynamic UI's
> * it is dead sexy when you use Ajax to add and remove the columns
>
> Is there a reason why the columns is implemented as an array instead
> of a collection that I am not aware of?
>
> Martijn
>