Package javax.faces.component

Examples of javax.faces.component.UISelectItems



    public void testValueBindings() {

  super.testValueBindings();
  UISelectItems test = (UISelectItems) component;

  // "value" property
  request.setAttribute("foo", "bar");
  test.setValue(null);
  assertNull(test.getValue());
  test.setValueBinding("value", application.createValueBinding("#{foo}"));
  assertNotNull(test.getValueBinding("value"));
  assertEquals("bar", test.getValue());
  test.setValue("baz");
  assertEquals("baz", test.getValue());
  test.setValue(null);
  assertEquals("bar", test.getValue());
  test.setValueBinding("value", null);
  assertNull(test.getValueBinding("value"));
  assertNull(test.getValue());

    }
View Full Code Here


    // --------------------------------------------------------- Support Methods


    // Create a pristine component of the type to be used in state holder tests
    protected UIComponent createComponent() {
        UIComponent component = new UISelectItems();
        component.setRendererType(null);
        return (component);
    }
View Full Code Here

  comboBox.getChildren().add(item1);
  comboBox.getChildren().add(item2);
  comboBox.getChildren().add(item3);
  comboBox.getChildren().add(item4);

  UISelectItems items = new UISelectItems();
  items.setValue(selectItems);
  comboBox.getChildren().add(items);
  form.getChildren().add(comboBox);
    }
View Full Code Here

                        si = new javax.faces.model.SelectItem(item.getItemValue(), item.getItemLabel(), item.getItemDescription(),
                                item.isItemDisabled());
                    }
                    result.add(si);
                } else if (uiComponent instanceof UISelectItems) {
                    UISelectItems items = (UISelectItems) uiComponent;
                    Object value = items.getValue();
                    if (value != null) {
                        if (value instanceof Collection) {
                            Collection col = (Collection) value;
                            for (Object item : col) {
                                if (item instanceof javax.faces.model.SelectItem) {
View Full Code Here

        return languagesSelectItems;
    }

    protected void validateValue(FacesContext context, Object value) {
        UISelectItems selectItems = new UISelectItems();
        selectItems.setTransient(true);
        selectItems.setValue(getLanguagesChoicesAsSelectItemList());
        getChildren().add(selectItems);
       
        super.validateValue(context,value);
    }
View Full Code Here

        return countriesSelectItems;
    }

    protected void validateValue(FacesContext context, Object value) {
        UISelectItems selectItems = new UISelectItems();
        selectItems.setTransient(true);
        selectItems.setValue(getCountriesChoicesAsSelectItemList());
        getChildren().add(selectItems);
       
        super.validateValue(context,value);
    }
View Full Code Here

        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
       
        List items = new ArrayList();
        items.add(new SelectItem("mars"));

        UISelectItems selectItems = new UISelectItems();
        selectItems.setValue(items);

        selectOneListbox.getChildren().add(selectItems);

        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectOneListbox, facesContext, writer, attrs);
View Full Code Here

        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
       
        List items = new ArrayList();
        items.add(new SelectItem("mars"));

        UISelectItems selectItems = new UISelectItems();
        selectItems.setValue(items);

        selectManyListbox.getChildren().add(selectItems);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectManyListbox, facesContext, writer, attrs);
View Full Code Here

        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
       
        List items = new ArrayList();
        items.add(new SelectItem("mars"));

        UISelectItems selectItems = new UISelectItems();
        selectItems.setValue(items);

        selectOneMenu.getChildren().add(selectItems);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectOneMenu, facesContext, writer, attrs);
View Full Code Here

        HtmlRenderedAttr[] attrs = HtmlCheckAttributesUtil.generateBasicAttrs();
       
        List items = new ArrayList();
        items.add(new SelectItem("mars"));

        UISelectItems selectItems = new UISelectItems();
        selectItems.setValue(items);

        selectManyMenu.getChildren().add(selectItems);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                selectManyMenu, facesContext, writer, attrs);
View Full Code Here

TOP

Related Classes of javax.faces.component.UISelectItems

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.