Package javax.faces.model

Examples of javax.faces.model.SelectItem


      boolean selected = ((selectedEntry < selectedCount) &&
                          (i == selectedIndices[selectedEntry]));
      if (selected)
        selectedEntry++;

      SelectItem item = selectItems.get(i);
      if (encodeSelectItem(context, arc, component, item, converter,
                           valuePassThru, accessKey,
                           i, selected, disabled,
                           renderedOne && isVertical,
                           itemOnclick))
View Full Code Here


  {
    ResponseWriter writer = context.getResponseWriter();
    int count = items.size();
    for (int i = 0; i < count; i++)
    {
      SelectItem item = items.get(i);
      writer.startElement("option", null);
      writer.writeAttribute("value", item.getValue(), null);
      if (i == selectedIndex)
        writer.writeAttribute("selected", Boolean.TRUE, null);
      writer.writeText(item.getLabel(), null);
      writer.endElement("option");
    }
  }
View Full Code Here

      }

      // =-=AEW I don't understand this next line...
      long currValue = showAllActive ? minValue - 1 : value;// Don't select

      SelectItem item = _createNavigationItem(context,
                                              arc,
                                              component,
                                              blockStart,
                                              currentRecordSize,
                                              maxValue,
View Full Code Here

    String[] parameters = new String[]{IntegerUtils.getString(maxValue)};
    String showAllText = XhtmlUtils.getFormattedString(
                                     arc.getTranslatedString(_SHOW_ALL_KEY),
                                     parameters);

    return new SelectItem(XhtmlConstants.VALUE_SHOW_ALL,
                          showAllText);
  }
View Full Code Here

                             blockStart,
                             blockSize,
                             maxValue,
                             rangeLabel);

    return new SelectItem(IntegerUtils.getString(blockStart),
                          text);
  }
View Full Code Here

      if (selectItems != null && !selectItems.isEmpty() && isNothingSelected)
      {
        // now check if the first item is already a blank item.
        // if it isn't, render a blank item, using the
        // noSelectionLabel attribute value as the itemLabel.
        SelectItem firstItem = selectItems.get(0);
        Object firstItemValue = firstItem.getValue();
        if (!("".equals(firstItemValue)))
        {
          Object label = component.getAttributes().get(
                           CoreSelectOneChoice.UNSELECTED_LABEL_KEY);
          String noSelectionLabel = (label != null) ? label.toString() : "";

          SelectItem item = new SelectItem("", noSelectionLabel, "", false);

          renderSelectItem(context, node, component, item,
                           "", false, false, 0);
        }
View Full Code Here

      return true;
    // now check if none of the items' values match the value.
    int size = selectItems.size();
    for (int i=0; i < size; i++)
    {
      SelectItem item = selectItems.get(i);
      if (value.equals(item.getValue()))
        return false;
    }
    return true;
  }
View Full Code Here

   
    int index = __getIndex(submittedValue, selectItems);
    if (index < 0)
      return null;

    SelectItem item = selectItems.get(index);
    if (item != null)
      return item.getValue();
    else
      return null;
  }
View Full Code Here

    // If an item is selected, get its label.
    String text;
    if (selectedIndex >= 0)
    {
      SelectItem item = selectItems.get(selectedIndex);
      text = item.getLabel();
    }
    else
    {
      text = getUnselectedLabel(bean);
    }
View Full Code Here

      List<SelectItem> selectItems)
  {
    int size = selectItems.size();
    for (int i = 0; i < size; i++)
    {
      SelectItem item = selectItems.get(i);
      if (item == null)
        continue;

      if (value == null)
      {
        Object itemValue = item.getValue();
        // =-=AEW Treat the empty string as if it were null
        if ((item == null) || (itemValue == null) || "".equals(itemValue))
          return i;
      }
      else
      {
        if (value.equals(item.getValue()))
          return i;
      }
    }

    return -1;
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.