use of com.github.bordertech.wcomponents.WDataTable in project wcomponents by BorderTech.
the class WDataTableRenderer_Test method testDoPaintSelectModeSingle.
@Test
public void testDoPaintSelectModeSingle() throws IOException, SAXException, XpathException {
WDataTable component = new WDataTable();
component.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL2_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL3_HEADING_TEST, WTextField.class));
TableDataModel tableModel = createTableModel();
component.setDataModel(tableModel);
component.setVisible(true);
component.setSelectMode(WDataTable.SelectMode.SINGLE);
assertXpathExists("//ui:table/ui:rowselection", component);
}
use of com.github.bordertech.wcomponents.WDataTable in project wcomponents by BorderTech.
the class WDataTableRenderer_Test method testDoPaintMissingAttributesColumnStripingSeparatorsBoth.
@Test
public void testDoPaintMissingAttributesColumnStripingSeparatorsBoth() throws IOException, SAXException, XpathException {
WDataTable component = new WDataTable();
component.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL2_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL3_HEADING_TEST, WTextField.class));
component.setDataModel(createTableModel());
component.setVisible(true);
component.setStripingType(WDataTable.StripingType.COLUMNS);
component.setSeparatorType(WDataTable.SeparatorType.BOTH);
assertXpathNotExists("//ui:table/@caption", component);
assertXpathEvaluatesTo("table", "//ui:table/@type", component);
assertXpathEvaluatesTo("cols", "//ui:table/@striping", component);
assertXpathEvaluatesTo("both", "//ui:table/@separators", component);
}
use of com.github.bordertech.wcomponents.WDataTable in project wcomponents by BorderTech.
the class WDataTableRenderer_Test method testDoPaintExpandModeDynamic.
@Test
public void testDoPaintExpandModeDynamic() throws IOException, SAXException, XpathException {
WDataTable component = new WDataTable();
component.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL2_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL3_HEADING_TEST, WTextField.class));
TableDataModel tableModel = createTableModel();
component.setDataModel(tableModel);
component.setVisible(true);
component.setExpandMode(ExpandMode.DYNAMIC);
assertXpathEvaluatesTo("dynamic", "//ui:table/ui:rowexpansion/@mode", component);
}
use of com.github.bordertech.wcomponents.WDataTable in project wcomponents by BorderTech.
the class WDataTableRenderer_Test method testRendererCorrectlyConfigured.
@Test
public void testRendererCorrectlyConfigured() {
WDataTable component = new WDataTable();
Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(component) instanceof WDataTableRenderer);
}
use of com.github.bordertech.wcomponents.WDataTable in project wcomponents by BorderTech.
the class WDataTableRenderer_Test method testDoPaintSelectModeMultipleSelectAllText.
@Test
public void testDoPaintSelectModeMultipleSelectAllText() throws IOException, SAXException, XpathException {
WDataTable component = new WDataTable();
component.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL2_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL3_HEADING_TEST, WTextField.class));
TableDataModel tableModel = createTableModel();
component.setDataModel(tableModel);
component.setVisible(true);
component.setSelectMode(WDataTable.SelectMode.MULTIPLE);
component.setSelectAllMode(WDataTable.SelectAllType.TEXT);
assertXpathExists("//ui:table/ui:rowselection", component);
assertXpathEvaluatesTo(TRUE, "//ui:table/ui:rowselection/@multiple", component);
assertXpathEvaluatesTo("text", "//ui:table/ui:rowselection/@selectAll", component);
}
Aggregations