1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.shared.taglib.core;
20
21 import org.apache.myfaces.shared.renderkit.JSFAttr;
22
23 import javax.el.ValueExpression;
24 import javax.faces.component.UIComponent;
25
26 public class SelectItemTagBase
27 extends org.apache.myfaces.shared.taglib.UIComponentELTagBase
28 {
29
30
31 public String getComponentType()
32 {
33 return "javax.faces.SelectItem";
34 }
35
36 public String getRendererType()
37 {
38 return null;
39 }
40
41
42 private ValueExpression _itemDisabled;
43 private ValueExpression _itemDescription;
44 private ValueExpression _itemLabel;
45 private ValueExpression _itemValue;
46 private ValueExpression _escape;
47 private ValueExpression _noSelectionOption;
48
49 protected void setProperties(UIComponent component)
50 {
51 super.setProperties(component);
52
53 setBooleanProperty(component, JSFAttr.ITEM_DISABLED_ATTR, _itemDisabled);
54 setStringProperty(component, JSFAttr.ITEM_DESCRIPTION_ATTR, _itemDescription);
55 setStringProperty(component, org.apache.myfaces.shared.renderkit.JSFAttr.ITEM_LABEL_ATTR, _itemLabel);
56 setStringProperty(component, JSFAttr.ITEM_VALUE_ATTR, _itemValue);
57 setBooleanProperty(component, JSFAttr.ITEM_ESCAPED_ATTR, _escape, Boolean.TRUE);
58 setBooleanProperty(component, JSFAttr.NO_SELECTION_OPTION_ATTR, _noSelectionOption, Boolean.FALSE);
59 }
60
61 public void setItemDisabled(ValueExpression itemDisabled)
62 {
63 _itemDisabled = itemDisabled;
64 }
65
66 public void setItemDescription(ValueExpression itemDescription)
67 {
68 _itemDescription = itemDescription;
69 }
70
71 public void setItemLabel(ValueExpression itemLabel)
72 {
73 _itemLabel = itemLabel;
74 }
75
76 @Deprecated
77 protected void setItemValue(String itemValue)
78 {
79 _itemValue = getFacesContext().getApplication().getExpressionFactory().createValueExpression(
80 getFacesContext().getELContext(),itemValue,String.class);
81 }
82
83 public void setItemValue(ValueExpression itemValue)
84 {
85 _itemValue = itemValue;
86 }
87
88 public void setEscape(ValueExpression escape)
89 {
90 _escape = escape;
91 }
92
93 protected ValueExpression getItemValue()
94 {
95 return _itemValue;
96 }
97
98 public void setNoSelectionOption(ValueExpression noSelectionOption)
99 {
100 _noSelectionOption = noSelectionOption;
101 }
102
103 }