Package javax.faces.model

Examples of javax.faces.model.SelectItem


        int refIdx = DcModules.get(wod.getModule()).getField(fieldIdx).getReferenceIdx();
        List<DcObject> refs = DataManager.get(refIdx, DcModules.get(refIdx).getMinimalFields(null));
       
        List<SelectItem> values = new ArrayList<SelectItem>();
        for (DcObject reference : refs) {
            values.add(new SelectItem(reference.getID(), reference.toString()));
        }
        references.setListItems(values);
    }
View Full Code Here


   @Create
   public void init()
   {
      knowledge = new ArrayList<String>();
      programmingLanguages = new ArrayList<SelectItem>();
      programmingLanguages.add(new SelectItem("JAVA", "Java"));
      programmingLanguages.add(new SelectItem("C", "C/C++"));
      programmingLanguages.add(new SelectItem("CS", "C#"));
      programmingLanguages.add(new SelectItem("VB", "VB"));
      languages = new ArrayList<SelectItem>();
      languages.add(new SelectItem("EN", "English"));
      languages.add(new SelectItem("FR", "French"));
      languages.add(new SelectItem("NL", "Dutch"));
      knowledge.add("FR");
      language = "FR";
      preferred = "FR";
   }
View Full Code Here

    public List<SelectItem> getProcessDefinitions()
    {
       List<SelectItem> result = new ArrayList<SelectItem>();
       for (String def: ORDER_DEFS)
       {
          result.add( new SelectItem(def, def.substring(0, def.length()-9)) );
       }
       return result;
    }
View Full Code Here

      iterator = extractSelectItems(facesContext,(UISelectItems)child).iterator();
    }       
    Object object = selectOne.getValue();
    Boolean disabled = (Boolean) selectOne.getAttributes().get("disabled");
    while(iterator.hasNext()){
      SelectItem selectItem  = (SelectItem) iterator.next();
      responseWriter.startElement("radio",null);
      responseWriter.writeAttribute("label",selectItem.getLabel(),"label");
      responseWriter.writeAttribute("value",selectItem.getValue(),"value");
      if(disabled != null){
        if(disabled.booleanValue()){
          responseWriter.writeAttribute("disabled","true","disabled");
        }
      }
      Object itemValue = selectItem.getValue();
      if(itemValue!=null){
        if(itemValue.equals(object)){
          responseWriter.writeAttribute("selected","true","selected");
       
      }
View Full Code Here

    encodeListHeads(context,component);
    encodeListCols(context,component);   
   
    Iterator iterator = getSelectItems(context,component);
    for(int i=0; iterator.hasNext(); i++){
      SelectItem selectItem  = (SelectItem) iterator.next();
      responseWriter.startElement("listitem",null);     
      responseWriter.writeAttribute("label",selectItem.getLabel(),"label");
      responseWriter.writeAttribute("value",getFormattedValue(context,component,selectItem.getValue()),"value");     
      Object itemValue = selectItem.getValue();
      if(itemValue!=null){
        if(values.contains(itemValue)){
          responseWriter.writeAttribute("selected","true","selected");
        }
      }   
View Full Code Here

       
    Object object = selectOne.getValue();
    responseWriter.startElement("menupopup",null);
    Iterator iterator = getSelectItems(context,selectOne);
    while(iterator.hasNext()){
      SelectItem selectItem = (SelectItem) iterator.next();
      responseWriter.startElement("menuitem",null);     
      responseWriter.writeAttribute("label",selectItem.getLabel(),"label");
      responseWriter.writeAttribute("value",getFormattedValue(context,component,selectItem.getValue()),"value");
      Object itemValue = selectItem.getValue();     
      if(itemValue!=null){
        if(itemValue.equals(object)){
          responseWriter.writeAttribute("selected","true","selected");
       
      }   
View Full Code Here

 
  protected List<SelectItem> extractSelectItems(FacesContext context, UISelectItem uiSelectItem){
    ArrayList<SelectItem> list = new ArrayList<SelectItem>();
    Object value = uiSelectItem.getValue();
    if (value == null) {     
      list.add(new SelectItem(uiSelectItem.getItemValue(), uiSelectItem.getItemLabel(), uiSelectItem.getItemDescription(), uiSelectItem
          .isItemDisabled()));
    } else if (value instanceof SelectItem) {
      list.add((SelectItem)value);
    } else {
      throw new IllegalArgumentException("");
View Full Code Here

        }
        Object val = ((Map) value).get(key);
        if (val == null) {
          continue;
        }
        list.add(new SelectItem(val.toString(), key.toString(), null));
      }
    } else {
      throw new IllegalArgumentException("");
    }
    return list;
View Full Code Here

        {
            public Object get(int index)
            {
                Locale locale = (Locale)AVAILABLE_LOCALES.get(index);
                String language = locale.getDisplayLanguage(locale);
                return new SelectItem(locale.getLanguage(), language, language);
            }

            public int size()
            {
                return AVAILABLE_LOCALES.size();
View Full Code Here

    final String clientId = component.getClientId(context);

    List<SelectItem> list = super.accrueSelectItems(component);
    int counter = 0;
    for (int i = 0; i < list.size(); i++) {
      SelectItem selectItem = list.get(i);
      if (selectItem instanceof SelectItemGroup) {

        if ("pageDirection".equals(layout)) {
          out.startElement("tr", component);
          out.write("\n");
        }

        out.startElement("td", component);

        out.write("\n");

        out.startElement("table", component);

        if (border > 0)
          out.writeAttribute("border", border, "border");

        if (style != null)
          out.writeAttribute("style", style, "style");

        if (styleClass != null)
          out.writeAttribute("class", styleClass, "class");

        if (disabled)
          out.writeAttribute("disabled", "disabled", "disabled");

        out.write("\n");

        if (!"pageDirection".equals(layout)) {
          out.startElement("tr", component);
          out.write("\n");
        }

        SelectItem []items = ((SelectItemGroup) selectItem).getSelectItems();

        for (int j = 0; j < items.length; j++) {

          SelectItem item = items[j];

          encodeChild(out,
                      component,
                      value,
                      item,
View Full Code Here

TOP

Related Classes of javax.faces.model.SelectItem

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.