UiBinder and FlexTable or Grid

3,983 views
Skip to first unread message

FKereki

unread,
Dec 9, 2009, 9:40:35 PM12/9/09
to Google Web Toolkit
Hi! Is it possible to include a FlexTable or Grid with UiBinder? How
do you specify each cell? And, for FlexTables, how can you join cells
together?

piyush sharma

unread,
Dec 10, 2009, 12:25:20 AM12/10/09
to google-we...@googlegroups.com
--

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



Craigo

unread,
Dec 10, 2009, 1:35:36 AM12/10/09
to Google Web Toolkit
I was trying to do this also. Then I slapped myself in the head and
realised, with the UiBinder, we can now just use plain html.

So we can do stuff like this:
<g:HTMLPanel>
<table>
<tr><td>Info:</td><td><g:TextBox ui:field="infoTextBox"/></
td></tr>
</table>
</g:HTMLPanel>

...there maybe a good reason you want to use a FlexTable in
the .ui.xml file, but I can't think of it.

FKereki

unread,
Dec 10, 2009, 5:41:27 AM12/10/09
to Google Web Toolkit
The idea was that FlexTable and Grid "hide" the HTML code, and avoid
any possible cross browser problems. If you go back to using HTML
directly, you may have to deal with browser quirks on your own. Of
course, with pretty simple HTML, that won't probably be a problem, but
what I like about GWT is being able of forgetting HTML and JavaScript
-- most of the time, at least.

Thomas Broyer

unread,
Dec 10, 2009, 8:53:12 AM12/10/09
to Google Web Toolkit


On Dec 10, 11:41 am, FKereki <fker...@gmail.com> wrote:
> The idea was that FlexTable and Grid "hide" the HTML code, and avoid
> any possible cross browser problems. If you go back to using HTML
> directly, you may have to deal with browser quirks on your own. Of
> course, with pretty simple HTML, that won't probably be a problem, but
> what I like about GWT is being able of forgetting HTML and JavaScript
> -- most of the time, at least.

Though for something as simple as a table, when you don't need to
handle events (such as the "cell click events" you get with FlexTable/
Grid), there isn't a single cross browser issue; and it'd really boost
your perfs!

As for you original question, AFAICT, you cannot "pre-populate" a
FlexTable or Grid with UiBinder, only instantiate the widget (with its
default 0,0 size, unless you use a @UiFactory or @UiField
(provided=true))

nvrs

unread,
Jan 5, 2010, 6:24:32 AM1/5/10
to Google Web Toolkit
Hi,

I fail to see how that code replaces FlexTable and what UiBinder has
to do with any of that??
The purpose of FlexTable is to provide an easy way of having tables of
arbitrary length so as...well rows can be added to them.
How are you going to replace that with hardcoded HTML? I don't see how
changing the contents of an HTML panel serve this purpose in a
fruitfull way.
Of course i may be missing something, so could you please provide some
pointers because i am trying to find the best way to use a flextalbe
with UiBinder.

On Dec 10 2009, 8:35 am, Craigo <craig...@gmail.com> wrote:
> I was trying to do this also.  Then I slapped myself in the head and

> realised, with theUiBinder, we can now just use plain html.


>
> So we can do stuff like this:
> <g:HTMLPanel>
>     <table>
>         <tr><td>Info:</td><td><g:TextBox ui:field="infoTextBox"/></
> td></tr>
>     </table>
> </g:HTMLPanel>
>
> ...there maybe a good reason you want to use aFlexTablein
> the .ui.xml file, but I can't think of it.
>
> On Dec 10, 1:40 pm, FKereki <fker...@gmail.com> wrote:
>
>
>

> > Hi! Is it possible to include aFlexTableor Grid withUiBinder? How

Thomas Broyer

unread,
Jan 5, 2010, 5:35:56 PM1/5/10
to Google Web Toolkit

On 5 jan, 12:24, nvrs <nvior...@gmail.com> wrote:
> Hi,
>
> I fail to see how that code replaces FlexTable and what UiBinder has
> to do with any of that??
> The purpose of FlexTable is to provide an easy way of having tables of
> arbitrary length so as...well rows can be added to them.

Many people also use FlexTable and Grid for layout, FlexTable having
the ability to colspan and/or rowspan cells.

> How are you going to replace that with hardcoded HTML? I don't see how
> changing the contents of an HTML panel serve this purpose in a
> fruitfull way.
> Of course i may be missing something, so could you please provide some
> pointers because i am trying to find the best way to use a flextalbe
> with UiBinder.

There's only a single way currently: instanciate an empty FlexTable in
UiBinder and then populate it in your Java code.
Well, there's another: wrap your FlexTable code in a Composite and use
the Composite in the UiBinder, but that's the same in the end.

nvrs

unread,
Jan 14, 2010, 5:50:45 AM1/14/10
to Google Web Toolkit
On Jan 6, 12:35 am, Thomas Broyer <t.bro...@gmail.com> wrote:

> There's only a single way currently: instanciate an empty FlexTable in
> UiBinder and then populate it in your Java code.
> Well, there's another: wrap your FlexTable code in a Composite and use
> the Composite in the UiBinder, but that's the same in the end.

I figured that out alright but it's sweeter than i originally thought.
As a matter of fact, if you instantiate a list of Widgets and a
FlexTable using UiBinder and then on the init code add the widgets to
the FlexTable, the Widgets show up in the FlexTable rows and not on
their container/parent!
Good thinking imho

aliman

unread,
Jan 15, 2010, 7:53:44 AM1/15/10
to Google Web Toolkit
I have another use case here, quite simple - I want to populate the
contents of a flextable (or grid) dynamically, but I want a fixed
header row. I also want to i18nise the contents of the header row. It
would be convenient if I could partially populate the content of a
flextable in the uibinder file, providing the header row using
<ui:msg>...</ui:msg> elements so I get the column headers included in
the i18n properties file. Any ideas?

Cheers,

Alistair

Reply all
Reply to author
Forward
0 new messages