Search in sources :

Example 46 with WFieldLayout

use of com.github.bordertech.wcomponents.WFieldLayout in project wcomponents by BorderTech.

the class WFieldRenderer_Test method testNoInputField.

@Test
public void testNoInputField() throws IOException, SAXException, XpathException {
    // No Input field, so label created by WTextWithColon.
    WText text = new WText("text1");
    WFieldLayout test = new WFieldLayout();
    WField field = test.addField("label1", text);
    // Validate Schema
    assertSchemaMatch(test);
    // Check Attributes
    assertXpathEvaluatesTo(field.getId(), "//ui:field/@id", field);
    // Check Label
    assertXpathEvaluatesTo("label1", "//ui:field/ui:label", field);
    // Check Input
    assertXpathEvaluatesTo("text1", "//ui:field/ui:input", field);
}
Also used : WField(com.github.bordertech.wcomponents.WField) WText(com.github.bordertech.wcomponents.WText) WFieldLayout(com.github.bordertech.wcomponents.WFieldLayout) Test(org.junit.Test)

Example 47 with WFieldLayout

use of com.github.bordertech.wcomponents.WFieldLayout in project wcomponents by BorderTech.

the class WFieldRenderer_Test method testRendererCorrectlyConfigured.

/**
 * Test the Layout is correctly configured.
 */
@Test
public void testRendererCorrectlyConfigured() {
    WField field = new WFieldLayout().addField("test1", new WTextArea());
    Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(field) instanceof WFieldRenderer);
}
Also used : WTextArea(com.github.bordertech.wcomponents.WTextArea) WField(com.github.bordertech.wcomponents.WField) WFieldLayout(com.github.bordertech.wcomponents.WFieldLayout) Test(org.junit.Test)

Aggregations

WFieldLayout (com.github.bordertech.wcomponents.WFieldLayout)47 WHeading (com.github.bordertech.wcomponents.WHeading)18 Test (org.junit.Test)13 ActionEvent (com.github.bordertech.wcomponents.ActionEvent)12 WButton (com.github.bordertech.wcomponents.WButton)11 WTextField (com.github.bordertech.wcomponents.WTextField)11 ExplanatoryText (com.github.bordertech.wcomponents.examples.common.ExplanatoryText)11 Margin (com.github.bordertech.wcomponents.Margin)10 WAjaxControl (com.github.bordertech.wcomponents.WAjaxControl)10 WField (com.github.bordertech.wcomponents.WField)10 WFieldSet (com.github.bordertech.wcomponents.WFieldSet)10 Action (com.github.bordertech.wcomponents.Action)8 WRadioButtonSelect (com.github.bordertech.wcomponents.WRadioButtonSelect)7 WCheckBoxSelect (com.github.bordertech.wcomponents.WCheckBoxSelect)6 WCheckBox (com.github.bordertech.wcomponents.WCheckBox)5 WContainer (com.github.bordertech.wcomponents.WContainer)5 WLabel (com.github.bordertech.wcomponents.WLabel)5 WText (com.github.bordertech.wcomponents.WText)5 Equal (com.github.bordertech.wcomponents.subordinate.Equal)5 Rule (com.github.bordertech.wcomponents.subordinate.Rule)5