Package javax.faces.component

Examples of javax.faces.component.UISelectMany


      throws IOException {
    
    ResponseWriter responseWriter = context.getResponseWriter();   
    List values = new ArrayList();
    if(component instanceof SelectManyListBoxComponent){
      UISelectMany selectMany = (UISelectMany) component;
      Object[] selectedValues = selectMany.getSelectedValues();     
      if( (selectedValues!= null) &&(selectedValues.length >0)){
        for(int i=0; i < selectedValues.length;i++){
          values.add(selectedValues[i]);
        }
      }
View Full Code Here


        ResponseWriter writer = facesContext.getResponseWriter();

        boolean isSelectItemGroup = (selectItem instanceof SelectItemGroup);

        UISelectMany selectMany = (UISelectMany) uiComponent;

        if (isSelectItemGroup)
        {
            if (pageDirectionLayout)
                writer.startElement(HTML.TR_ELEM, selectMany);
View Full Code Here

    public static Set getSubmittedOrSelectedValuesAsSet(boolean selectMany, UIComponent uiComponent, FacesContext facesContext, Converter converter) {
        Set lookupSet;

        if (selectMany) {
            UISelectMany uiSelectMany = (UISelectMany) uiComponent;
            lookupSet = RendererUtils.getSubmittedValuesAsSet(facesContext, uiComponent, converter, uiSelectMany);
            if (lookupSet == null)
            {
                lookupSet = RendererUtils.getSelectedValuesAsSet(facesContext, uiComponent, converter, uiSelectMany);
            }
View Full Code Here

     
      boolean isSelectItemGroup = (selectItem instanceof SelectItemGroup);
     
      Object itemValue = selectItem.getValue(); // TODO : Check here for getSubmittedValue. Look at RendererUtils.getValue

      UISelectMany selectMany = (UISelectMany)uiComponent;
     
        String itemStrValue;
        if (converter == null) {
            itemStrValue = itemValue.toString();
        } else {
            itemStrValue = converter.getAsString(facesContext, selectMany,
                    itemValue);
        }

        if (isSelectItemGroup) {
          if (pageDirectionLayout)
                writer.startElement(HTML.TR_ELEM, selectMany);
         
          writer.startElement(HTML.TD_ELEM, selectMany);
          writer.write(selectItem.getLabel());
          writer.endElement(HTML.TD_ELEM);
         
          if (pageDirectionLayout) {
            writer.endElement(HTML.TR_ELEM);
            writer.startElement(HTML.TR_ELEM, selectMany);
          }
          writer.startElement(HTML.TD_ELEM, selectMany);
         
          writer.startElement(HTML.TABLE_ELEM, selectMany);
          writer.writeAttribute(HTML.BORDER_ATTR, "0", null);

          SelectItemGroup group = (SelectItemGroup) selectItem;
          SelectItem[] selectItems = group.getSelectItems();
         
          for (int i=0; i<selectItems.length; i++) {
            renderGroupOrItemCheckbox(facesContext, selectMany, selectItems[i], useSubmittedValues, lookupSet, converter, pageDirectionLayout);
          }
         
          writer.endElement(HTML.TD_ELEM);
          writer.endElement(HTML.TR_ELEM);
          writer.endElement(HTML.TABLE_ELEM);
          writer.endElement(HTML.TD_ELEM);
         
          if (pageDirectionLayout)
                writer.endElement(HTML.TR_ELEM);
         
        } else {
       
        writer.write("\t\t");
        if (pageDirectionLayout)
            writer.startElement(HTML.TR_ELEM, selectMany);
        writer.startElement(HTML.TD_ELEM, selectMany);
        writer.startElement(HTML.LABEL_ELEM, selectMany);

        boolean checked = lookupSet.contains(itemStrValue);

        boolean disabled = selectItem.isDisabled();
       

        String labelClass = null;
        boolean componentDisabled = isDisabled(facesContext, selectMany);

        if (componentDisabled || disabled) {
            labelClass = (String) selectMany.getAttributes().get(JSFAttr.DISABLED_CLASS_ATTR);
        } else {
            labelClass = (String) selectMany.getAttributes().get(JSFAttr.ENABLED_CLASS_ATTR);
        }
        if (labelClass != null) {
            writer.writeAttribute("class", labelClass, "labelClass");
        }
View Full Code Here

                    useSubmittedValues, lookupSet, converter,
                    pageDirectionLayout);
        }
        else
        {
            UISelectMany selectMany = (UISelectMany) uiComponent;
            Object itemValue = selectItem.getValue(); // TODO : Check here for getSubmittedValue. Look at RendererUtils.getValue
            String itemStrValue = getItemStringValue(facesContext, selectMany,
                    converter, itemValue);

            boolean checked = (useSubmittedValues && lookupSet
View Full Code Here

    protected void renderCheckboxGroup(FacesContext facesContext,
            UIComponent uiComponent, SelectItemGroup selectItemGroup,
            boolean useSubmittedValues, Set lookupSet,
            Converter converter, boolean pageDirectionLayout) throws IOException {
        ResponseWriter writer = facesContext.getResponseWriter();
        UISelectMany selectMany = (UISelectMany)uiComponent;
        writer.startElement(HTML.TABLE_ELEM, selectMany);
        if (pageDirectionLayout)
            writer.startElement(HTML.TR_ELEM, selectMany);
        writer.startElement(HTML.TD_ELEM, selectMany);
        if (selectItemGroup.isEscape())
View Full Code Here

        if (!(uiComponent instanceof UISelectMany))
        {
            throw new IllegalStateException("UISelectMany expected");
        }

        UISelectMany uiSelectMany = (UISelectMany)uiComponent;
        Converter converter = getConverter(facesContext, uiSelectMany);
        List selectItemList = RendererUtils.getSelectItemList(uiSelectMany);
        if (index >= selectItemList.size())
        {
            throw new IndexOutOfBoundsException("index " + index + " >= " + selectItemList.size());
View Full Code Here

  public void decode(FacesContext facesContext, UIComponent component) {
    if (ComponentUtil.isOutputOnly(component)) {
      return;
    }
    if (component instanceof UISelectMany) {
      UISelectMany uiSelectMany = (UISelectMany) component;

      String[] newValues = (String[])
        facesContext.getExternalContext().getRequestParameterValuesMap().get(uiSelectMany.getClientId(facesContext));
      if (LOG.isDebugEnabled()) {
        LOG.debug("decode: key='" + component.getClientId(facesContext)
            + "' value='" + Arrays.toString(newValues) + "'");
        LOG.debug("size ... '" + (newValues != null ? newValues.length : -1) + "'");
        if (newValues != null) {
          for (String newValue : newValues) {
            LOG.debug("newValues[i] = '" + newValue + "'");
          }
        }
      }

      if (newValues == null) {
        newValues = new String[0]; // because no selection will not submitted by browsers
      }
      uiSelectMany.setSubmittedValue(newValues);
    }
  }
View Full Code Here

        ResponseWriter writer = facesContext.getResponseWriter();

        boolean isSelectItemGroup = (selectItem instanceof SelectItemGroup);

        UISelectMany selectMany = (UISelectMany) uiComponent;

        if (isSelectItemGroup)
        {
            if (pageDirectionLayout)
            {
View Full Code Here

            Converter converter)
    {
        Set lookupSet;
        if (selectMany)
        {
            UISelectMany uiSelectMany = (UISelectMany) uiComponent;
            lookupSet = RendererUtils.getSubmittedValuesAsSet(facesContext,
                    uiComponent, converter, uiSelectMany);
            if (lookupSet == null)
            {
                lookupSet = RendererUtils.getSelectedValuesAsSet(facesContext,
View Full Code Here

TOP

Related Classes of javax.faces.component.UISelectMany

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.