Search in sources :

Example 1 with TestStringColumn

use of org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumnTest.TestTable.TestStringColumn in project scout.rt by eclipse.

the class AbstractStringColumnTest method testCustomValidation.

@Test
public void testCustomValidation() {
    TestTable table = new TestTable();
    TestStringColumn col = table.getTestStringColumn();
    ITableRow row = table.addRowByArray(new Object[] { "valid" });
    IStringField editor = (IStringField) col.prepareEdit(row);
    editor.setValue("invalid");
    col.completeEdit(row, editor);
    assertFalse(table.getCell(0, 0).isContentValid());
}
Also used : IStringField(org.eclipse.scout.rt.client.ui.form.fields.stringfield.IStringField) ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) TestStringColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumnTest.TestTable.TestStringColumn) Test(org.junit.Test)

Example 2 with TestStringColumn

use of org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumnTest.TestTable.TestStringColumn in project scout.rt by eclipse.

the class AbstractStringColumnTest method testMaxLengthValidation.

@Test
public void testMaxLengthValidation() {
    TestTable table = new TestTable();
    TestStringColumn col = table.getTestStringColumn();
    col.setMaxLength(1);
    table.addRowByArray(new Object[] { "text" });
    assertEquals("t", table.getCell(0, 0).getValue());
}
Also used : TestStringColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumnTest.TestTable.TestStringColumn) Test(org.junit.Test)

Aggregations

TestStringColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumnTest.TestTable.TestStringColumn)2 Test (org.junit.Test)2 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)1 IStringField (org.eclipse.scout.rt.client.ui.form.fields.stringfield.IStringField)1