I'm making a widget in an application using the GWT framework. it is a table of 13 columns and 3 rows. The first line is the names of the months. The first column is the names of the lines - income and expense. The remaining data is filled in from the service.
Now the first column is filled with the setRowNames() method. you need to make sure that these names are filled in the ui.xml file.
public class FinancialWidget extends Composite {
/**
*
*/
FlexTable flexTable;
/**
*
*/
private void setRowsNames() {
flexTable.setText(0, 0, "Month");
flexTable.setText(1, 0, "income");
flexTable.setText(2, 0, "expence");
}
}
<gwt:HTMLPanel>
<gwt:FlexTable ui:field="financialFlexTable"/>
</gwt:HTMLPanel>
I tried to implement it like this
<gwt:FlexTable ui:field="financialFlexTable">
<tr>
<td>month</td>
</tr>
<tr>
<td>income</td>
</tr>
<tr>
<td>expence</td>
</tr>
</gwt:FlexTable>
-- compilation error
<gwt:FlexTable ui:field="financialFlexTable">
<gwt:row>
<gwt:cell>month</gwt:cell>
</gwt:row>
<gwt:row>
<gwt:cell>income</gwt:cell>
</gwt:row>
<gwt:row>
<gwt:cell>expence</gwt:cell>
</gwt:row>
</gwt:FlexTable>
gwt:row, gwt:cell - does not exist
Your question is not clear enough.
ui.xmlfile is not usual html file. You cannot generate table both from code and with basic html tags.First of all - did you read the docs with examples?
The way that I use
FlexTablein project is to table.setWidget().Maybe you need to use
DataGridif your table is rendering from one object type. In some ways it's more convenient.