HTMLPanel handles this case just fine. (See HTMLPanelTest.) But yes,
UiBinder probably doesn't. I suppose it could do the same trick HTMLPanel
does--you mind filing an issue?

But allocating a widget per row isn't a great plan anyway, it won't scale.
UiBinder is not a renderer--it's for laying out assemblies of widgets, not
iterating over data to build them. We don't yet have a tool for that. (Or
were you thinking in terms of pure DOM objects?)

Besides FlexTable you might also look at the incubator's PagingScrollTable.

On Oct 9, 2009 6:23 PM, "Amir Kashani" <amirkash...@gmail.com> wrote:

HTMLPanel's ability to mimic other tags is limited in that it can't become a
TR or TD. Following the implementation, it's clear why: placing these
elements without their requried parent tags into a DIV is invalid so the
browser never creates the DOM element that HTMLPanel requires. UiBinder is
similarly limited: the top level tag cannot be a TR or TD, since
UiBinder.attachToDomAndGetChild copies HTMLPanel's logic.

As a result, it's near impossible to create a TABLE in UiBinder that has a
dynamic number of rows, a very common use case. The obvious approach is to
create MyTable.ui.xml that contains a bound TABLE element. Then, in a
separate file, MyTableRow.ui.xml, define the contents of each row with the
root element being a TR. This doesn't work for the reason mentioned above. A
simple workaround is to have MyTableRow.ui.xml have TABLE as it's root
element, then bind its TR (or retrieve it with getFirstChild) and
appendChild the row to the TABLE element from MyTable.  This breaks down as
soon as you want a widget within the rows of a table, however.

As far as I can tell, the only way around this is to use a FlexTable or
Grid. These work great, except that you lose the ability to define a row
with complex markup in an XML file.

Unless I'm really missing something, I don't see a good solution here. I
have some rough idea of how this could be solved with a new table widget
that can define its rows separately from the outer table, but it's not
hashed out and probably doesn't fall under the "good idea" category.

Thoughts?

- Amir


--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to