Search in sources :

Example 16 with WDataTable

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);
}
Also used : WTableColumn(com.github.bordertech.wcomponents.WTableColumn) WDataTable(com.github.bordertech.wcomponents.WDataTable) SimpleTableDataModel(com.github.bordertech.wcomponents.SimpleTableDataModel) TableDataModel(com.github.bordertech.wcomponents.TableDataModel) WTextField(com.github.bordertech.wcomponents.WTextField) Test(org.junit.Test)

Example 17 with WDataTable

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);
}
Also used : WTableColumn(com.github.bordertech.wcomponents.WTableColumn) WDataTable(com.github.bordertech.wcomponents.WDataTable) WTextField(com.github.bordertech.wcomponents.WTextField) Test(org.junit.Test)

Example 18 with WDataTable

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);
}
Also used : WTableColumn(com.github.bordertech.wcomponents.WTableColumn) WDataTable(com.github.bordertech.wcomponents.WDataTable) SimpleTableDataModel(com.github.bordertech.wcomponents.SimpleTableDataModel) TableDataModel(com.github.bordertech.wcomponents.TableDataModel) WTextField(com.github.bordertech.wcomponents.WTextField) Test(org.junit.Test)

Example 19 with WDataTable

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);
}
Also used : WDataTable(com.github.bordertech.wcomponents.WDataTable) Test(org.junit.Test)

Example 20 with WDataTable

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);
}
Also used : WTableColumn(com.github.bordertech.wcomponents.WTableColumn) WDataTable(com.github.bordertech.wcomponents.WDataTable) SimpleTableDataModel(com.github.bordertech.wcomponents.SimpleTableDataModel) TableDataModel(com.github.bordertech.wcomponents.TableDataModel) WTextField(com.github.bordertech.wcomponents.WTextField) Test(org.junit.Test)

Aggregations

WDataTable (com.github.bordertech.wcomponents.WDataTable)41 WTableColumn (com.github.bordertech.wcomponents.WTableColumn)38 WTextField (com.github.bordertech.wcomponents.WTextField)29 Test (org.junit.Test)28 SimpleTableDataModel (com.github.bordertech.wcomponents.SimpleTableDataModel)23 TableDataModel (com.github.bordertech.wcomponents.TableDataModel)23 WText (com.github.bordertech.wcomponents.WText)8 TableTreeNode (com.github.bordertech.wcomponents.TableTreeNode)5 WButton (com.github.bordertech.wcomponents.WButton)5 ActionConstraint (com.github.bordertech.wcomponents.WDataTable.ActionConstraint)4 WDateField (com.github.bordertech.wcomponents.WDateField)4 XmlStringBuilder (com.github.bordertech.wcomponents.XmlStringBuilder)3 UIContext (com.github.bordertech.wcomponents.UIContext)2 TreeTableDataModel (com.github.bordertech.wcomponents.TreeTableDataModel)1 WComponent (com.github.bordertech.wcomponents.WComponent)1 WDataTableRowRenderer (com.github.bordertech.wcomponents.WDataTableRowRenderer)1 WRepeater (com.github.bordertech.wcomponents.WRepeater)1 SubUIContext (com.github.bordertech.wcomponents.WRepeater.SubUIContext)1 SystemException (com.github.bordertech.wcomponents.util.SystemException)1 TreeNode (com.github.bordertech.wcomponents.util.TreeNode)1