use of jakarta.faces.component.UISelectItem in project myfaces by apache.
the class HtmlCheckboxRendererTest method testSelectManyHtmlPropertyPassTru.
public void testSelectManyHtmlPropertyPassTru() throws Exception {
HtmlRenderedAttr[] attrs = { // _AccesskeyProperty
new HtmlRenderedAttr("accesskey"), // _UniversalProperties
new HtmlRenderedAttr("dir"), new HtmlRenderedAttr("lang"), new HtmlRenderedAttr("title"), new HtmlRenderedAttr("role"), // _FocusBlurProperties
new HtmlRenderedAttr("onfocus"), new HtmlRenderedAttr("onblur"), // _ChangeSelectProperties
new HtmlRenderedAttr("onchange"), new HtmlRenderedAttr("onselect"), // _EventProperties
new HtmlRenderedAttr("onclick"), new HtmlRenderedAttr("ondblclick"), new HtmlRenderedAttr("onkeydown"), new HtmlRenderedAttr("onkeypress"), new HtmlRenderedAttr("onkeyup"), new HtmlRenderedAttr("onmousedown"), new HtmlRenderedAttr("onmousemove"), new HtmlRenderedAttr("onmouseout"), new HtmlRenderedAttr("onmouseover"), new HtmlRenderedAttr("onmouseup"), // _StyleProperties
new HtmlRenderedAttr("style", 1), new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\"", 1), // _TabindexProperty
new HtmlRenderedAttr("tabindex") };
UISelectItem item = new UISelectItem();
item.setItemLabel("mars");
item.setItemValue("mars");
selectManyCheckbox.getChildren().add(item);
HtmlCheckAttributesUtil.checkRenderedAttributes(selectManyCheckbox, facesContext, writer, attrs);
if (HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
Assert.fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
}
}
use of jakarta.faces.component.UISelectItem in project myfaces by apache.
the class HtmlEscapeRendererTest method tryUISelectEscapeValue.
public void tryUISelectEscapeValue(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, true);
uiSelectItem.setValue(item);
component.getChildren().add(uiSelectItem);
component.encodeAll(facesContext);
facesContext.renderResponse();
String output = swriter.toString();
Assert.assertTrue(output.contains(TEST_STRING_ESCAPED));
}
use of jakarta.faces.component.UISelectItem in project myfaces by apache.
the class HtmlSelectManyListboxClientBehaviorRendererTest method createComponentToTest.
@Override
protected UIComponent createComponentToTest() {
UIComponent component = new HtmlSelectManyListbox();
UISelectItem item = new UISelectItem();
item.setItemValue("value1");
component.getChildren().add(item);
return component;
}
use of jakarta.faces.component.UISelectItem in project myfaces by apache.
the class HtmlSelectOneListboxClientBehaviorRendererTest method createComponentToTest.
@Override
protected UIComponent createComponentToTest() {
UIComponent component = new HtmlSelectOneListbox();
UISelectItem item = new UISelectItem();
item.setItemValue("value1");
component.getChildren().add(item);
return component;
}
use of jakarta.faces.component.UISelectItem in project faces by jakartaee.
the class TestServlet method uiSelectItemIsSetItemEscapedTest.
// uiSelectItemIsSetItemDisabledTest
public void uiSelectItemIsSetItemEscapedTest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
UISelectItem command = (UISelectItem) createComponent();
boolean value = true;
command.setItemEscaped(value);
boolean result = command.isItemEscaped();
if (!result) {
out.println(JSFTestUtil.FAIL + " UISelectItem.isItemEscaped() didn't return" + " the value as set by UISelectItem.setItemEscaped().");
out.println("Expected: " + value);
out.println("Received: " + result);
return;
}
out.println(JSFTestUtil.PASS);
}
Aggregations