1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.shared_orchestra.taglib.core;
20
21 import org.apache.myfaces.shared_orchestra.renderkit.JSFAttr;
22
23 import javax.faces.component.UIComponent;
24
25
26
27
28
29 public class SelectItemTagBase
30 extends org.apache.myfaces.shared_orchestra.taglib.UIComponentTagBase
31 {
32
33
34 public String getComponentType()
35 {
36 return "javax.faces.SelectItem";
37 }
38
39 public String getRendererType()
40 {
41 return null;
42 }
43
44
45 private String _itemDisabled;
46 private String _itemDescription;
47 private String _itemLabel;
48 private String _itemValue;
49
50 protected void setProperties(UIComponent component)
51 {
52 super.setProperties(component);
53
54 setBooleanProperty(component, JSFAttr.ITEM_DISABLED_ATTR, _itemDisabled);
55 setStringProperty(component, JSFAttr.ITEM_DESCRIPTION_ATTR, _itemDescription);
56 setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.ITEM_LABEL_ATTR, _itemLabel);
57 setStringProperty(component, JSFAttr.ITEM_VALUE_ATTR, _itemValue);
58
59 if (_itemValue == null &&
60 component.getValueBinding("binding") == null &&
61 component.getValueBinding("value") == null)
62 {
63 throw new IllegalArgumentException("SelectItem with no value");
64 }
65 }
66
67 public void setItemDisabled(String itemDisabled)
68 {
69 _itemDisabled = itemDisabled;
70 }
71
72 public void setItemDescription(String itemDescription)
73 {
74 _itemDescription = itemDescription;
75 }
76
77 public void setItemLabel(String itemLabel)
78 {
79 _itemLabel = itemLabel;
80 }
81
82 public void setItemValue(String itemValue)
83 {
84 _itemValue = itemValue;
85 }
86
87 public String getItemValue()
88 {
89 return _itemValue;
90 }
91
92 }