use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WDataTableRenderer_Test method testDoPaintSelectModeMultipleSelectAllControl.
@Test
public void testDoPaintSelectModeMultipleSelectAllControl() 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.CONTROL);
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 WDataTableRenderer_Test method testDoPaintExpandModeServer.
// SERVER outputs "dynamic" see https://github.com/BorderTech/wcomponents/issues/701
@Test
public void testDoPaintExpandModeServer() 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.SERVER);
assertXpathEvaluatesTo("dynamic", "//ui:table/ui:rowexpansion/@mode", component);
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WDataTableRenderer_Test method testDoPaintPaginatedClient.
@Test
public void testDoPaintPaginatedClient() 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.setPaginationMode(PaginationMode.CLIENT);
setActiveContext(createUIContext());
assertXpathEvaluatesTo("client", "//ui:table/ui:pagination/@mode", component);
assertXpathEvaluatesTo((new Integer(component.getCurrentPage())).toString(), "//ui:table/ui:pagination/@currentPage", component);
assertXpathEvaluatesTo((new Integer(component.getRowsPerPage())).toString(), "//ui:table/ui:pagination/@rowsPerPage", component);
assertXpathEvaluatesTo((new Integer(tableModel.getRowCount())).toString(), "//ui:table/ui:pagination/@rows", component);
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WDataTableRenderer_Test method testDoPaintTableActionsInvisibleButton.
@Test
public void testDoPaintTableActionsInvisibleButton() 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);
WButton button1 = new WButton(TEST_ACTION_ONE);
component.addAction(button1);
// Visible
assertXpathExists("//ui:table/ui:actions", component);
// Not Visible
button1.setVisible(false);
assertXpathNotExists("//ui:table/ui:actions", component);
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WDataTableRenderer_Test method testDoPaintPaginatedDynamic.
@Test
public void testDoPaintPaginatedDynamic() 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.setPaginationMode(PaginationMode.DYNAMIC);
setActiveContext(createUIContext());
assertXpathEvaluatesTo("dynamic", "//ui:table/ui:pagination/@mode", component);
assertXpathEvaluatesTo((new Integer(component.getCurrentPage())).toString(), "//ui:table/ui:pagination/@currentPage", component);
assertXpathEvaluatesTo((new Integer(component.getRowsPerPage())).toString(), "//ui:table/ui:pagination/@rowsPerPage", component);
assertXpathEvaluatesTo((new Integer(tableModel.getRowCount())).toString(), "//ui:table/ui:pagination/@rows", component);
}
Aggregations