You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alec Leamas <le...@gmail.com> on 2008/03/25 15:13:19 UTC
Newbie,T5: Grid limitations (long).
First of all: Overall is Tapestry 5 in general and the the Grid
component in particular an amazing piece of software. So this is *not*
complaints, just an attempt to sort things out, to share my experiences
and check that I understand things correctly.
I have a use case where I'm about to present data in a table. The table
is presenting different databases from time to time, so the db layout
varies. At first glance, I thought the Grid would solve my problems, the
Tapestry 4 did with some tweaks. However, I've run into follwong
limitations:
- The paging policy with a fixed number of numbered pages is hardcoded
and can't be changed. Other policies e. g., overlap between pages or
pages started at random points in the input vector is not possible. This
has been discussed earlier, and is according to HLS a design decision.
- It is not possible to change the overall rendering of a row e. g,, to
to embed each <TR>...</TR> in a <DIV class=xxx> <TR>...</TR></DIV>. (e.
g., if a row should wrapped in a microformat).
- It is not possible to change the layout of the table header if you
don't know the name of the column/attribute at compile time. Of course,
you cannot reference an unknown column in the template. But it might be
possible to define a catch all block ("DefaultColumnCell?) which is the
layout for all columns, with provisions to access the current column's
name. Again, this can't be done as of 5.0.11.
- It is not possible to enumerate the properties in the BeanModel data
source (is is possible to list the editable properties, though). Minor
issue, I guess.
Personally, the conclusion is of course to write my own component, no
problem. But maybe some of this or similar info should go into the Wiki,
it would definitely have saved some time for me. There is really a lot
of info what *can* be done with this rather complex and powerful
component. Maybe it's time to add some info about what *can't* be done
with it. Maybe some issue should be a RFE in the JIRA?
Cheers
--Alec
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Newbie,T5: Grid limitations (long).
Posted by Howard Lewis Ship <hl...@gmail.com>.
There's certainly an issue that if the Grid component grew to
encompass every possible user's most remote needs, the end result
would not be useable by anybody (a Grid component with 27 required
parameters of which six are detailed interfaces, etc., etc.). The
point is, the common components need to hit a 90/10 rule of
usefulness. A secondary goal would be to make the underlying
components of Grid (GridRows, GridColumns, GridPager) easy to
reuse/extend for a more application-specific Grid implementation.
On Tue, Mar 25, 2008 at 2:41 PM, Alec Leamas <le...@gmail.com> wrote:
> Jesper Zedlitz wrote:
> > Alec Leamas wrote:
> >
> >> - The paging policy with a fixed number of numbered pages is hardcoded
> >> and can't be changed. Other policies e. g., overlap between pages
> >>
> >>
> > Isn't that something you can handle inside your own GridDataSource? With the
> > page number, the number of results per page, the number of overlapping
> > items (ok, you need a separate parameter for that) it should be possible
> > return the correct entries.
> >
> >
> Obviouly, I was not clear about this. It's about starting a page at just
> any item, not just on even page boundaries as defined by the page size.
> See
> http://www.nabble.com/T5%2C-newbie%3A-Grid-use-w-dynamic-columns-td16080438.html
>
> >> - It is not possible to change the overall rendering of a row e. g,, to
> >> to embed each <TR>...</TR> in a <DIV class=xxx> <TR>...</TR></DIV>.
> >>
> >>
> > That is not valid XHTML 1.0 Strict
> >
> > I do not know enough about the Grid component to write something about the
> > other questions. What I miss is the "columns" attribute from T4's Table
> > component..
> Yep, when coming from T4 you miss the column component.
>
> Anyway, I don't want to write bad HTML. So after some more RTFM I've
> concluded that the microformat issue (the <tr>...</tr> above) can be
> resolved by the rowclass attribute, together with som explicit column
> fomatting as described in the manual.
>
> One item of four resolved. Thanks!
>
> --alec
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
Creator Apache Tapestry and Apache HiveMind
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Newbie,T5: Grid limitations (long).
Posted by Alec Leamas <le...@gmail.com>.
Jesper Zedlitz wrote:
> Alec Leamas wrote:
>
>> - The paging policy with a fixed number of numbered pages is hardcoded
>> and can't be changed. Other policies e. g., overlap between pages
>>
>>
> Isn't that something you can handle inside your own GridDataSource? With the
> page number, the number of results per page, the number of overlapping
> items (ok, you need a separate parameter for that) it should be possible
> return the correct entries.
>
>
Obviouly, I was not clear about this. It's about starting a page at just
any item, not just on even page boundaries as defined by the page size.
See
http://www.nabble.com/T5%2C-newbie%3A-Grid-use-w-dynamic-columns-td16080438.html
>> - It is not possible to change the overall rendering of a row e. g,, to
>> to embed each <TR>...</TR> in a <DIV class=xxx> <TR>...</TR></DIV>.
>>
>>
> That is not valid XHTML 1.0 Strict
>
> I do not know enough about the Grid component to write something about the
> other questions. What I miss is the "columns" attribute from T4's Table
> component..
Yep, when coming from T4 you miss the column component.
Anyway, I don't want to write bad HTML. So after some more RTFM I've
concluded that the microformat issue (the <tr>...</tr> above) can be
resolved by the rowclass attribute, together with som explicit column
fomatting as described in the manual.
One item of four resolved. Thanks!
--alec
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Newbie,T5: Grid limitations (long).
Posted by Jesper Zedlitz <jz...@informatik.uni-kiel.de>.
Alec Leamas wrote:
> - The paging policy with a fixed number of numbered pages is hardcoded
> and can't be changed. Other policies e. g., overlap between pages
>
Isn't that something you can handle inside your own GridDataSource? With the
page number, the number of results per page, the number of overlapping
items (ok, you need a separate parameter for that) it should be possible
return the correct entries.
> pages started at random points in the input vector is not possible.
>
Maybe this works:
Inject the Grid component into your page using
@Component
private Grid grid;
When setting up the result you set a random page - something like this:
int numberOfPages = (int)(result.size()/grid.getRowsPerPage());
grid.setCurrentPage( (int)(Math.random() * numberOfPages) );
> - It is not possible to change the overall rendering of a row e. g,, to
> to embed each <TR>...</TR> in a <DIV class=xxx> <TR>...</TR></DIV>.
>
That is not valid XHTML 1.0 Strict
I do not know enough about the Grid component to write something about the
other questions. What I miss is the "columns" attribute from T4's Table
component...
Jesper
--
Jesper Zedlitz Dept. for Computer Science, CAU of Kiel
Room 1108 Communication Systems Research Group
Phone: +49-(0)431-880-7279
Christian-Albrechts-Platz 4 Fax: +49-(0)431-880-7615
24098 Kiel - Germany jze@informatik.uni-kiel.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org