Search in sources :

Example 1 with TableWithBooleanColumn

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

the class JsonCellToJsonTest method testBooleanColumn.

@Test
public void testBooleanColumn() throws JSONException {
    TableWithBooleanColumn table = new TableWithBooleanColumn();
    table.initTable();
    ITableRow row = table.addRow(table.createRow());
    table.getColumn().setValue(row, true);
    JsonTable<ITable> jsonTable = UiSessionTestUtility.newJsonAdapter(m_uiSession, table, null);
    JSONObject jsonObj = (JSONObject) jsonTable.cellToJson(row, table.getColumn());
    Assert.assertEquals(true, jsonObj.get("value"));
    table.getColumn().setValue(row, false);
    jsonObj = (JSONObject) jsonTable.cellToJson(row, table.getColumn());
    Assert.assertEquals(false, jsonObj.get("value"));
}
Also used : JSONObject(org.json.JSONObject) ITable(org.eclipse.scout.rt.client.ui.basic.table.ITable) ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) TableWithBooleanColumn(org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithBooleanColumn) 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 TableWithBooleanColumn (org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithBooleanColumn)1 JSONObject (org.json.JSONObject)1 Test (org.junit.Test)1