Search in sources :

Example 1 with TableWithStringColumn

use of org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithStringColumn in project scout.rt by eclipse.

the class JsonCellToJsonTest method testStringColumn.

/**
 * Don't generate a cell object if text is the only property.
 */
@Test
public void testStringColumn() throws JSONException {
    TableWithStringColumn table = new TableWithStringColumn();
    table.initTable();
    ITableRow row = table.addRow(table.createRow());
    table.getColumn().setValue(row, "A string");
    JsonTable<ITable> jsonTable = UiSessionTestUtility.newJsonAdapter(m_uiSession, table, null);
    Object jsonObj = jsonTable.cellToJson(row, table.getColumn());
    assertTrue(jsonObj instanceof String);
}
Also used : TableWithStringColumn(org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithStringColumn) ITable(org.eclipse.scout.rt.client.ui.basic.table.ITable) JSONObject(org.json.JSONObject) ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) Test(org.junit.Test)

Aggregations

ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)1 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)1 TableWithStringColumn (org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithStringColumn)1 JSONObject (org.json.JSONObject)1 Test (org.junit.Test)1