use of org.eclipse.scout.rt.client.ui.form.fields.tablefield.ITableField in project scout.rt by eclipse.
the class JsonTableFieldTest method testPreventTableDisposal.
@Test
public void testPreventTableDisposal() {
// Create tablePage
IPageWithTable<?> tablePage = createTablePageAndSelectNode();
ITable tablePageTable = tablePage.getTable();
JsonOutline<IOutline> jsonOutline = UiSessionTestUtility.newJsonAdapter(m_uiSession, tablePage.getOutline(), null);
Assert.assertNotNull(jsonOutline.getAdapter(tablePageTable));
// Create table field which uses the table from the table page
ITableField<ITable> tableField = new TableField<ITable>();
JsonTableField<ITableField<?>> jsonTableField = UiSessionTestUtility.newJsonAdapter(m_uiSession, tableField, null);
tableField.setTable(tablePageTable, true);
// Dispose table field -> table must not be disposed because table page still needs it
jsonTableField.dispose();
assertNotNull(jsonOutline.getAdapter(tablePageTable));
assertTrue(jsonOutline.getAdapter(tablePageTable).isInitialized());
}
Aggregations