Search in sources :

Example 1 with HtmlSelectManyMenu

use of jakarta.faces.component.html.HtmlSelectManyMenu in project myfaces by apache.

the class HtmlMenuRendererTest method setUp.

public void setUp() throws Exception {
    super.setUp();
    selectOneMenu = new HtmlSelectOneMenu();
    selectManyMenu = new HtmlSelectManyMenu();
    writer = new MockResponseWriter(new StringWriter(), null, null);
    facesContext.setResponseWriter(writer);
    facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
    facesContext.getRenderKit().addRenderer(selectOneMenu.getFamily(), selectOneMenu.getRendererType(), new HtmlMenuRenderer());
    facesContext.getRenderKit().addRenderer(selectManyMenu.getFamily(), selectManyMenu.getRendererType(), new HtmlMenuRenderer());
    facesContext.getAttributes().put("org.apache.myfaces.RENDERED_FACES_JS", Boolean.TRUE);
}
Also used : HtmlSelectManyMenu(jakarta.faces.component.html.HtmlSelectManyMenu) StringWriter(java.io.StringWriter) HtmlSelectOneMenu(jakarta.faces.component.html.HtmlSelectOneMenu) MockResponseWriter(org.apache.myfaces.test.mock.MockResponseWriter)

Example 2 with HtmlSelectManyMenu

use of jakarta.faces.component.html.HtmlSelectManyMenu in project myfaces by apache.

the class HtmlEscapeRendererTest method setUp.

public void setUp() throws Exception {
    super.setUp();
    outputText = new HtmlOutputText();
    outputLabel = new HtmlOutputLabel();
    selectOneRadio = new HtmlSelectOneRadio();
    selectOneListbox = new HtmlSelectOneListbox();
    selectOneMenu = new HtmlSelectOneMenu();
    selectManyCheckbox = new HtmlSelectManyCheckbox();
    selectManyListbox = new HtmlSelectManyListbox();
    selectManyMenu = new HtmlSelectManyMenu();
    // TODO remove these two lines once myfaces-test goes alpha, see MYFACES-1155
    facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
    facesContext.getRenderKit().addRenderer(outputText.getFamily(), outputText.getRendererType(), new HtmlTextRenderer());
    facesContext.getRenderKit().addRenderer(outputLabel.getFamily(), outputLabel.getRendererType(), new HtmlLabelRenderer());
    facesContext.getRenderKit().addRenderer(selectOneRadio.getFamily(), selectOneRadio.getRendererType(), new HtmlRadioRenderer());
    facesContext.getRenderKit().addRenderer(selectOneListbox.getFamily(), selectOneListbox.getRendererType(), new HtmlListboxRenderer());
    facesContext.getRenderKit().addRenderer(selectOneMenu.getFamily(), selectOneMenu.getRendererType(), new HtmlMenuRenderer());
    facesContext.getRenderKit().addRenderer(selectManyCheckbox.getFamily(), selectManyCheckbox.getRendererType(), new HtmlCheckboxRenderer());
    facesContext.getRenderKit().addRenderer(selectManyListbox.getFamily(), selectManyListbox.getRendererType(), new HtmlListboxRenderer());
    facesContext.getRenderKit().addRenderer(selectManyMenu.getFamily(), selectManyMenu.getRendererType(), new HtmlMenuRenderer());
    facesContext.getAttributes().put("org.apache.myfaces.RENDERED_FACES_JS", Boolean.TRUE);
}
Also used : HtmlSelectOneListbox(jakarta.faces.component.html.HtmlSelectOneListbox) HtmlSelectOneMenu(jakarta.faces.component.html.HtmlSelectOneMenu) HtmlOutputLabel(jakarta.faces.component.html.HtmlOutputLabel) HtmlSelectOneRadio(jakarta.faces.component.html.HtmlSelectOneRadio) HtmlSelectManyMenu(jakarta.faces.component.html.HtmlSelectManyMenu) HtmlSelectManyListbox(jakarta.faces.component.html.HtmlSelectManyListbox) HtmlOutputText(jakarta.faces.component.html.HtmlOutputText) HtmlSelectManyCheckbox(jakarta.faces.component.html.HtmlSelectManyCheckbox)

Example 3 with HtmlSelectManyMenu

use of jakarta.faces.component.html.HtmlSelectManyMenu 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)

Aggregations

HtmlSelectManyMenu (jakarta.faces.component.html.HtmlSelectManyMenu)3 HtmlSelectOneMenu (jakarta.faces.component.html.HtmlSelectOneMenu)2 UIComponent (jakarta.faces.component.UIComponent)1 UISelectItem (jakarta.faces.component.UISelectItem)1 HtmlOutputLabel (jakarta.faces.component.html.HtmlOutputLabel)1 HtmlOutputText (jakarta.faces.component.html.HtmlOutputText)1 HtmlSelectManyCheckbox (jakarta.faces.component.html.HtmlSelectManyCheckbox)1 HtmlSelectManyListbox (jakarta.faces.component.html.HtmlSelectManyListbox)1 HtmlSelectOneListbox (jakarta.faces.component.html.HtmlSelectOneListbox)1 HtmlSelectOneRadio (jakarta.faces.component.html.HtmlSelectOneRadio)1 StringWriter (java.io.StringWriter)1 MockResponseWriter (org.apache.myfaces.test.mock.MockResponseWriter)1