Author: abelevich
Date: 2008-12-10 10:33:41 -0500 (Wed, 10 Dec 2008)
New Revision: 11696
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
RF-5245
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
---
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-12-10
15:12:55 UTC (rev 11695)
+++
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-12-10
15:33:41 UTC (rev 11696)
@@ -371,6 +371,10 @@
}
}
+ private boolean isDefOptionValue(Object value) {
+ return value != null ? "".equals(((String)value).trim()) : true;
+ }
+
/**
* Gets script.
*
@@ -397,8 +401,17 @@
String option = OPTIONS[i];
Object value = attributes.get(option);
+ if(option.equals("entryClass") && isDefOptionValue(value))
{
+ value = "richfaces_suggestionEntry";
+ }
+
+ if(option.equals("selectValueClass") &&
isDefOptionValue(value)) {
+ value = "richfaces_suggestionSelectValue";
+ }
+
if (null != value) {
if (!"frequency".equals(option) || ((Double)
value).doubleValue() > 1E-9) {
+
options.put(option, value);
}
}
@@ -429,7 +442,11 @@
}
if (component.getValueBinding("fetchValue") != null
|| attributes.get("fetchValue") != null) {
- options.put("select",
attributes.get("selectValueClass"));
+ Object select = attributes.get("selectValueClass");
+ if (isDefOptionValue(select)) {
+ select = "richfaces_suggestionSelectValue";
+ }
+ options.put("select", select);
}
UISuggestionBox suggestionBox = (UISuggestionBox) component;
@@ -890,8 +907,10 @@
public final String getEntryClass(final FacesContext context,
final UIComponent component) {
String entryClass = (String) component.getAttributes().get("entryClass");
- if (null == entryClass)
- entryClass = "";
+ if (isDefOptionValue(entryClass)) {
+ entryClass = "richfaces_suggestionEntry";
+ }
+
String rowClass = (String) component.getAttributes().get("rowClasses");
if (null == rowClass)
rowClass = "";
Show replies by date