protected Object getValues(UIComponent component) { UISelectMany selectMany = (UISelectMany) component; Object value = selectMany.getValue(); if (value == null) { return null; } else if (value instanceof Collection) { return ((Collection) value).toArray(); } else if (value.getClass().isArray()) { if (Array.getLength(value) == 0) { return null; } } else { throw new FacesException("Value of '" + component.getClientId() + "'must be an array or a collection"); } return value; }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> * * @return the selected values, or <code>null</code>. */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
public Object[] getSelectedValues() { return (Object[]) getValue(); }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> * * @return the selected values, or <code>null</code>. */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
public Object[] getSelectedValues() { return (Object[]) getValue(); }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> * * @return the selected values, or <code>null</code>. */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> * * @return the selected values, or <code>null</code>. */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> * * @return the selected values, or <code>null</code>. */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> * * @return the selected values, or <code>null</code>. */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
/** * <p>Return the currently selected values, or <code>null</code> if there * are no currently selected values. This is a typesafe alias for * <code>getValue()</code>.</p> * * @return the selected values, or <code>null</code>. */ public Object[] getSelectedValues() { return ((Object[]) getValue()); }
public Object[] getSelectedValues() { return (Object[]) getValue(); }
/** * Convenient utility method that returns the currently selected values of * a UISelectMany component as a Set, of which the contains method can then be * easily used to determine if a value is currently selected. * Calling the contains method of this Set with the item value * as argument returns true if this item is selected. * * @param uiSelectMany * @return Set containing all currently selected values */ public static Set getSelectedValuesAsSet(FacesContext context, UIComponent component, Converter converter, UISelectMany uiSelectMany) { Object selectedValues = uiSelectMany.getValue(); return internalSubmittedOrSelectedValuesAsSet(context, component, converter, uiSelectMany, selectedValues); }
/** * Convenient utility method that returns the currently selected values of * a UISelectMany component as a Set, of which the contains method can then be * easily used to determine if a value is currently selected. * Calling the contains method of this Set with the item value * as argument returns true if this item is selected. * * @param uiSelectMany * @return Set containing all currently selected values */ public static Set getSelectedValuesAsSet(FacesContext context, UIComponent component, Converter converter, UISelectMany uiSelectMany) { Object selectedValues = uiSelectMany.getValue(); return internalSubmittedOrSelectedValuesAsSet(context, component, converter, uiSelectMany, selectedValues); }
/** * Convenient utility method that returns the currently selected values of * a UISelectMany component as a Set, of which the contains method can then be * easily used to determine if a value is currently selected. * Calling the contains method of this Set with the item value * as argument returns true if this item is selected. * @param uiSelectMany * @return Set containing all currently selected values */ public static Set getSelectedValuesAsSet(FacesContext context, UIComponent component, Converter converter, UISelectMany uiSelectMany) { Object selectedValues = uiSelectMany.getValue(); return internalSubmittedOrSelectedValuesAsSet(context, component, converter, uiSelectMany, selectedValues); }
/** * Convenient utility method that returns the currently selected values of * a UISelectMany component as a Set, of which the contains method can then be * easily used to determine if a value is currently selected. * Calling the contains method of this Set with the item value * as argument returns true if this item is selected. * @param uiSelectMany * @return Set containing all currently selected values */ public static Set getSelectedValuesAsSet(FacesContext context, UIComponent component, Converter converter, UISelectMany uiSelectMany) { Object selectedValues = uiSelectMany.getValue(); return internalSubmittedOrSelectedValuesAsSet(context, component, converter, uiSelectMany, selectedValues); }
/** * Convenient utility method that returns the currently selected values of * a UISelectMany component as a Set, of which the contains method can then be * easily used to determine if a value is currently selected. * Calling the contains method of this Set with the item value * as argument returns true if this item is selected. * @param uiSelectMany * @return Set containing all currently selected values */ public static Set getSelectedValuesAsSet(FacesContext context, UIComponent component, Converter converter, UISelectMany uiSelectMany) { Object selectedValues = uiSelectMany.getValue(); return internalSubmittedOrSelectedValuesAsSet(context, component, converter, uiSelectMany, selectedValues); }
@Override protected Map<String, Object> getValues(UIComponent component) { UISelectMany selectMany = (UISelectMany) component; Object value = selectMany.getValue(); if (value == null) { return null; } else if (value instanceof Map) { // it should be a Map instance for <ItemStringValue,Value> return ((Map) value); } else { throw new FacesException("Value of '" + component.getClientId() + "'must be a Map instance"); } }