use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintEmptyTableNoAttributes.
@Test
public void testDoPaintEmptyTableNoAttributes() throws IOException, SAXException, XpathException {
WTable component = new WTable();
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.setVisible(true);
setActiveContext(createUIContext());
assertXpathEvaluatesTo(component.getNoDataMessage(), "//ui:table/ui:tbody/ui:nodata", component);
assertSchemaMatch(component);
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintMissingAttributesRowStriping.
@Test
public void testDoPaintMissingAttributesRowStriping() throws IOException, SAXException, XpathException {
WTable component = new WTable();
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.setTableModel(createTableModel());
component.setVisible(true);
component.setStripingType(WTable.StripingType.ROWS);
component.setSeparatorType(WTable.SeparatorType.HORIZONTAL);
assertSchemaMatch(component);
assertXpathNotExists("//ui:table/@caption", component);
assertXpathEvaluatesTo("table", "//ui:table/@type", component);
assertXpathEvaluatesTo("rows", "//ui:table/@striping", component);
assertXpathEvaluatesTo("horizontal", "//ui:table/@separators", component);
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintSelectModeMultipleSelectAllControl.
@Test
public void testDoPaintSelectModeMultipleSelectAllControl() throws IOException, SAXException, XpathException {
WTable component = new WTable();
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));
TableModel tableModel = createTableModel();
component.setTableModel(tableModel);
component.setVisible(true);
component.setSelectMode(WTable.SelectMode.MULTIPLE);
component.setSelectAllMode(WTable.SelectAllType.CONTROL);
assertSchemaMatch(component);
assertXpathExists("//ui:table/ui:rowselection", component);
assertXpathEvaluatesTo(TRUE, "//ui:table/ui:rowselection/@multiple", component);
assertXpathEvaluatesTo("control", "//ui:table/ui:rowselection/@selectAll", component);
// toggle not available by default
assertXpathNotExists("//ui:table/ui:rowselection/@toggle", component);
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintSelectModeMultipleSelectAllControlSubmitOnChangeAndGroupName.
@Test
public void testDoPaintSelectModeMultipleSelectAllControlSubmitOnChangeAndGroupName() throws IOException, SAXException, XpathException {
WTable component = new WTable();
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));
TableModel tableModel = createTableModel();
component.setTableModel(tableModel);
component.setVisible(true);
component.setSelectMode(WTable.SelectMode.MULTIPLE);
component.setSelectAllMode(WTable.SelectAllType.CONTROL);
setActiveContext(createUIContext());
assertSchemaMatch(component);
assertXpathExists("//ui:table/ui:rowselection", component);
assertXpathEvaluatesTo(TRUE, "//ui:table/ui:rowselection/@multiple", component);
assertXpathEvaluatesTo("control", "//ui:table/ui:rowselection/@selectAll", component);
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintTableActionsInvisibleButton.
@Test
public void testDoPaintTableActionsInvisibleButton() throws IOException, SAXException, XpathException {
WTable component = new WTable();
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));
TableModel tableModel = createTableModel();
component.setTableModel(tableModel);
component.setVisible(true);
WButton button1 = new WButton(TEST_ACTION_ONE);
component.addAction(button1);
assertSchemaMatch(component);
// Visible
assertXpathExists("//ui:table/ui:actions", component);
// Not Visible
button1.setVisible(false);
assertXpathNotExists("//ui:table/ui:actions", component);
}
Aggregations