UIBinder - CellTable<T> - how to specify T?

419 views
Skip to first unread message

Magnus

unread,
Oct 20, 2012, 8:05:45 PM10/20/12
to google-we...@googlegroups.com
Hi,

when I use a CellTable within a UIBinder specification, how can I define a type T for the CellTable?

Before UIBinder, I created it like this:
CellTable<MyType> = new CellTable<MyType>();

With UIBinder, I get a composite widget with a CellTable somewhere in it. But how can I specify the type?

Magnus

Andrei

unread,
Oct 21, 2012, 2:28:14 PM10/21/12
to google-we...@googlegroups.com
Why do you to specify type in Ui:Binder? You simply tell Ui:Binder "this is where my cell table will be". You can set a style, specify size, even set some additional parameters, but there is no need to specify a type in Ui:Binder.

Andrei

unread,
Oct 21, 2012, 2:31:58 PM10/21/12
to google-we...@googlegroups.com
I should have mentioned that in your view you do:

@UiField CellTable<T> myTable;

Milan Cvejic

unread,
Oct 21, 2012, 11:24:28 PM10/21/12
to google-we...@googlegroups.com
You can not specify type in UiBinder. What you should do is define celltable using UiBinder

and in java you declare your table using

@UiField(provided = true)
CellTable<MyType> cellTable;

public MyClass() {
  cellTable = new CellTable<MyType>();
  initWidget(uiBinder.createAndBindUi(this));
Reply all
Reply to author
Forward
0 new messages