Search in sources :

Example 21 with UISelectItem

use of jakarta.faces.component.UISelectItem in project myfaces by apache.

the class HtmlEscapeRendererTest method tryUISelectNoEscapeValue.

public void tryUISelectNoEscapeValue(UIComponent component, String contentType, String encoding) throws Exception {
    StringWriter swriter = new StringWriter();
    HtmlResponseWriterImpl writer = new HtmlResponseWriterImpl(swriter, contentType, encoding);
    facesContext.setResponseWriter(writer);
    UISelectItem uiSelectItem = new UISelectItem();
    SelectItem item = new SelectItem("Output", TEST_STRING, "", false, false);
    uiSelectItem.setValue(item);
    component.getChildren().add(uiSelectItem);
    component.encodeAll(facesContext);
    facesContext.renderResponse();
    String output = swriter.toString();
    Assert.assertTrue(output.contains(TEST_STRING));
}
Also used : StringWriter(java.io.StringWriter) UISelectItem(jakarta.faces.component.UISelectItem) SelectItem(jakarta.faces.model.SelectItem) UISelectItem(jakarta.faces.component.UISelectItem)

Example 22 with UISelectItem

use of jakarta.faces.component.UISelectItem in project myfaces by apache.

the class HtmlSelectManyCheckboxClientBehaviorRendererTest method createComponentToTest.

@Override
protected UIComponent createComponentToTest() {
    UIComponent component = new HtmlSelectManyCheckbox();
    UISelectItem item = new UISelectItem();
    item.setItemValue("value1");
    component.getChildren().add(item);
    return component;
}
Also used : UIComponent(jakarta.faces.component.UIComponent) HtmlSelectManyCheckbox(jakarta.faces.component.html.HtmlSelectManyCheckbox) UISelectItem(jakarta.faces.component.UISelectItem)

Example 23 with UISelectItem

use of jakarta.faces.component.UISelectItem in project myfaces by apache.

the class HtmlSelectManyMenuClientBehaviorRendererTest method createComponentToTest.

@Override
protected UIComponent createComponentToTest() {
    UIComponent component = new HtmlSelectManyMenu();
    UISelectItem item = new UISelectItem();
    item.setItemValue("value1");
    component.getChildren().add(item);
    return component;
}
Also used : HtmlSelectManyMenu(jakarta.faces.component.html.HtmlSelectManyMenu) UIComponent(jakarta.faces.component.UIComponent) UISelectItem(jakarta.faces.component.UISelectItem)

Example 24 with UISelectItem

use of jakarta.faces.component.UISelectItem in project myfaces by apache.

the class HtmlSelectOneMenuClientBehaviorRendererTest method createComponentToTest.

@Override
protected UIComponent createComponentToTest() {
    UIComponent component = new HtmlSelectOneMenu();
    UISelectItem item = new UISelectItem();
    item.setItemValue("value1");
    component.getChildren().add(item);
    return component;
}
Also used : UIComponent(jakarta.faces.component.UIComponent) HtmlSelectOneMenu(jakarta.faces.component.html.HtmlSelectOneMenu) UISelectItem(jakarta.faces.component.UISelectItem)

Example 25 with UISelectItem

use of jakarta.faces.component.UISelectItem in project myfaces by apache.

the class HtmlSelectOneRadioClientBehaviorRendererTest method createComponentToTest.

@Override
protected UIComponent createComponentToTest() {
    UIComponent component = new HtmlSelectOneRadio();
    UISelectItem item = new UISelectItem();
    item.setItemValue("value1");
    component.getChildren().add(item);
    return component;
}
Also used : UIComponent(jakarta.faces.component.UIComponent) HtmlSelectOneRadio(jakarta.faces.component.html.HtmlSelectOneRadio) UISelectItem(jakarta.faces.component.UISelectItem)

Aggregations

UISelectItem (jakarta.faces.component.UISelectItem)37 PrintWriter (java.io.PrintWriter)17 UIInput (jakarta.faces.component.UIInput)10 UIViewRoot (jakarta.faces.component.UIViewRoot)10 FacesContext (jakarta.faces.context.FacesContext)10 UIComponent (jakarta.faces.component.UIComponent)8 TCKValidator (com.sun.ts.tests.jsf.api.jakarta_faces.component.common.TCKValidator)6 TCKValueChangeListener (com.sun.ts.tests.jsf.api.jakarta_faces.component.common.TCKValueChangeListener)6 MethodExpression (jakarta.el.MethodExpression)6 AjaxBehavior (jakarta.faces.component.behavior.AjaxBehavior)6 MethodExpressionValidator (jakarta.faces.validator.MethodExpressionValidator)6 SelectItem (jakarta.faces.model.SelectItem)5 ELContext (jakarta.el.ELContext)4 ValueExpression (jakarta.el.ValueExpression)3 UISelectItems (jakarta.faces.component.UISelectItems)3 Application (jakarta.faces.application.Application)2 StringWriter (java.io.StringWriter)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 TCKConverter (com.sun.ts.tests.jsf.api.jakarta_faces.component.common.TCKConverter)1