I want my table to have the following static column headings: "Name", "Surname", "DOB", but I want to declare them in *.ui.xml (rather than in code).
Right now, I'm doing it via code like this:
public PersonViewImpl extends Composite implements PersonView {
/*Lots of code removed for clarity*/
@UiField (provided = true) FlexTable personTable;
public PersonViewImpl(){
personTable.setText(0, 0, "Name");
personTable.setText(0, 1, "Surname");
personTable.setText(0, 2, "DOB")
}
}
I have this in my PersonView.ui.xml
<g:FlexTable ui:field="personTable" />
I've googled for hours, but still no go.
You cannot set FlexTable's cell elements in UI Binder, probably you should have your own custom widget which renders tr and td. For example, like explained here: GWT table row as UiBinder