Hi,
I have a page with, say, 4 tables. Since each table row includes a checkbox I have to use the rowtablearea2 control, so I can use arbitrary controls to build the rows. In the majority of cases, the tables contain 1 - 8 entries each, but the exact number of entries per table is dynamic and depends on database contents. I would like to achieve a layout where each table is displayed with exactly as much rows as it has entries and with exactly the height that is needed by that number of rows. However, I didn’t find an easy solution for that problem.
If I do not specify the height for the control but define a rowcount, the table is always rendered with exactly that number of rows. If the table contains less entries, there are blank rows, if the table contains more rows, the user has to scroll. If I specify the height attribute (absolute or as a percentage), the table is rendered with that height and as much rows as possible for this height.
Did I miss something obvious here? Perhaps there is an easy solution which I’m just to blind to see. Right now, it seems there is now way to control the number of rows or the height of the table dynamically. But that’s what I would expect from a table control. So something like a rowcountprop attribute that controls the number of rows by getting the value from the adapter at runtime would really be handy … do you think this could be a reasonable feature request?
Workaround
The only solution to this problem I have found so far is a rather crude workaround involving nested hsplits - it seems that’s the only control/container where you can specify the height dynamically. The basic idea looks like this (since I also want to hide some tables from time to time the real page layout also has rowdynavis containers mixed into the layout hierarchy but they aren’t of any importance for the problem at hand):
<hsplit heighttopprop="hsplitHeightTop0">
<splitcell>
<rowtablearea2>
...
</rowtablearea2>
</splitcell>
<splitcell>
<hsplit heighttopprop="hsplitHeightTop1">
<splitcell>
<rowtablearea2>
...
</rowtablearea2>
</splitcell>
<splitcell>
<hsplit heighttopprop="hsplitHeightTop2">
<splitcell>
<rowtablearea2>
...
</rowtablearea2>
</splitcell>
<splitcell>
<hsplit heighttopprop="hsplitHeightTop3">
<splitcell>
<rowtablearea2>
...
</rowtablearea2>
</splitcell>
<splitcell>
<vdist height="100%">
</vdist>
</splitcell>
</hsplit>
</splitcell>
</hsplit>
</splitcell>
</hsplit>
</splitcell>
</hsplit>
In the adapter code I calculate hsplitHeightTop[0,1,2,3] according to the number of entries in each table. It works. But imho it’s much more complicated than it should be. There are two more drawbacks:
- [list]
There is a 3px line visible between the tables, obviously this is the separator that the hsplit control paints. I couldn’t find a way to get rid of this.[*:45c97059bc]The user can (inadvertently) change the height of the tables by moving the aforementioned separator.
[/list]
Any input on this issue is welcome.
Regards
Bastian