View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package javax.faces.component.html;
20  
21  import javax.faces.component.UISelectMany;
22  
23  import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
24  
25  /**
26   * Allow the user to select zero or more items from a set of
27   * available options. This is presented as a listbox which allows
28   * multiple rows in the list to be selected simultaneously.
29   * <p>
30   * The set of available options is defined by adding child
31   * f:selectItem or f:selectItems components to this component.
32   * </p>
33   * <p>
34   * The list is rendered as an HTML select element. The "multiple"
35   * attribute is set on the element and the size attribute is set to
36   * the provided value, defaulting to the number of items in the list
37   * if no value is provided. If the size is set to 1, then a
38   * "drop-down" list (aka "combo-box") is presented, though if this is
39   * the intention then a selectManyMenu should be used instead.
40   * </p>
41   * <p>
42   * The value attribute must be a value-binding expression to a
43   * property of type List, Object array or primitive array. That
44   * "collection" is expected to contain objects of the same type as
45   * SelectItem.getValue() returns for the child SelectItem objects.
46   * On rendering, any child whose value is in the list will be
47   * selected initially. During the update phase, the property is set
48   * to contain a "collection" of values for those child SelectItem
49   * objects that are currently selected.
50   * </p>
51   *
52   */
53  @JSFComponent
54  (name = "h:selectManyListbox",
55  clazz = "javax.faces.component.html.HtmlSelectManyListbox",template=true,
56  tagClass = "org.apache.myfaces.taglib.html.HtmlSelectManyListboxTag",
57  defaultRendererType = "javax.faces.Listbox",
58  implementz = "javax.faces.component.behavior.ClientBehaviorHolder",
59  defaultEventName = "valueChange"
60  )
61  abstract class _HtmlSelectManyListbox extends UISelectMany implements 
62  _AccesskeyProperty, _UniversalProperties, _DisabledReadonlyProperties,
63  _FocusBlurProperties, _ChangeSelectProperties, _EventProperties,
64  _StyleProperties, _TabindexProperty, _DisabledClassEnabledClassProperties,
65  _LabelProperty, _RoleProperty
66  {
67  
68    static public final String COMPONENT_FAMILY =
69      "javax.faces.SelectMany";
70    static public final String COMPONENT_TYPE =
71      "javax.faces.HtmlSelectManyListbox";
72  
73    /**
74     * see JSF Spec.
75     * 
76     * @JSFProperty
77     *   defaultValue="Integer.MIN_VALUE"
78     */
79    public abstract int getSize();
80  
81  }