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 | 0 | public class SelectItemTagBase |
27 | |
extends org.apache.myfaces.shared.taglib.UIComponentELTagBase |
28 | |
{ |
29 | |
|
30 | |
|
31 | |
public String getComponentType() |
32 | |
{ |
33 | 0 | return "javax.faces.SelectItem"; |
34 | |
} |
35 | |
|
36 | |
public String getRendererType() |
37 | |
{ |
38 | 0 | 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 | 0 | super.setProperties(component); |
52 | |
|
53 | 0 | setBooleanProperty(component, JSFAttr.ITEM_DISABLED_ATTR, _itemDisabled); |
54 | 0 | setStringProperty(component, JSFAttr.ITEM_DESCRIPTION_ATTR, _itemDescription); |
55 | 0 | setStringProperty(component, org.apache.myfaces.shared.renderkit.JSFAttr.ITEM_LABEL_ATTR, _itemLabel); |
56 | 0 | setStringProperty(component, JSFAttr.ITEM_VALUE_ATTR, _itemValue); |
57 | 0 | setBooleanProperty(component, JSFAttr.ITEM_ESCAPED_ATTR, _escape, Boolean.TRUE); |
58 | 0 | setBooleanProperty(component, JSFAttr.NO_SELECTION_OPTION_ATTR, _noSelectionOption, Boolean.FALSE); |
59 | 0 | } |
60 | |
|
61 | |
public void setItemDisabled(ValueExpression itemDisabled) |
62 | |
{ |
63 | 0 | _itemDisabled = itemDisabled; |
64 | 0 | } |
65 | |
|
66 | |
public void setItemDescription(ValueExpression itemDescription) |
67 | |
{ |
68 | 0 | _itemDescription = itemDescription; |
69 | 0 | } |
70 | |
|
71 | |
public void setItemLabel(ValueExpression itemLabel) |
72 | |
{ |
73 | 0 | _itemLabel = itemLabel; |
74 | 0 | } |
75 | |
|
76 | |
@Deprecated |
77 | |
protected void setItemValue(String itemValue) |
78 | |
{ |
79 | 0 | _itemValue = getFacesContext().getApplication().getExpressionFactory().createValueExpression( |
80 | |
getFacesContext().getELContext(),itemValue,String.class); |
81 | 0 | } |
82 | |
|
83 | |
public void setItemValue(ValueExpression itemValue) |
84 | |
{ |
85 | 0 | _itemValue = itemValue; |
86 | 0 | } |
87 | |
|
88 | |
public void setEscape(ValueExpression escape) |
89 | |
{ |
90 | 0 | _escape = escape; |
91 | 0 | } |
92 | |
|
93 | |
protected ValueExpression getItemValue() |
94 | |
{ |
95 | 0 | return _itemValue; |
96 | |
} |
97 | |
|
98 | |
public void setNoSelectionOption(ValueExpression noSelectionOption) |
99 | |
{ |
100 | 0 | _noSelectionOption = noSelectionOption; |
101 | 0 | } |
102 | |
|
103 | |
} |