Author: sergeyhalipov
Date: 2007-09-27 11:46:24 -0400 (Thu, 27 Sep 2007)
New Revision: 3146
Modified:
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-1023
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2007-09-27 15:38:31
UTC (rev 3145)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2007-09-27 15:46:24
UTC (rev 3146)
@@ -181,7 +181,8 @@
<description>
HTML CSS class attribute of element for pop-up
suggestion content
- </description>
+ </description>
+ <defaultvalue>""</defaultvalue>
</property>
<property>
<name>popupStyle</name>
@@ -189,7 +190,24 @@
<description>
HTML CSS style attribute of element for pop-up
suggestion content
- </description>
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>style</name>
+ <classname>java.lang.String</classname>
+ <description>
+ CSS style(s) is/are to be applied when this component is rendered
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>styleClass</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Corresponds to the HTML class attribute
+ </description>
+ <defaultvalue>""</defaultvalue>
</property>
<property>
<name>frequency</name>
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
===================================================================
---
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2007-09-27
15:38:31 UTC (rev 3145)
+++
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2007-09-27
15:46:24 UTC (rev 3146)
@@ -356,4 +356,68 @@
removeFacesListener(listener);
}
+ /**
+ * Getter for styleClass.
+ *
+ * Corresponds to the HTML class attribute
+ *
+ * @return styleClass value from local variable or value bindings
+ */
+ public abstract String getStyleClass();
+
+ /**
+ * Setter for styleClass.
+ *
+ * @param value class
+ */
+ public abstract void setStyleClass(String value);
+
+ /**
+ * Getter for popupClass.
+ *
+ * HTML CSS class attribute of element for pop-up suggestion content
+ *
+ * @return popupClass value from local variable or value bindings
+ */
+ public abstract String getPopupClass();
+
+ /**
+ * Setter for popupClass.
+ *
+ * @param value class
+ */
+ public abstract void setPopupClass(String value);
+
+ /**
+ * Getter for style.
+ *
+ * CSS style(s) is/are to be applied when this component is rendered
+ *
+ * @return style value from local variable or value bindings
+ */
+ public abstract String getStyle();
+
+ /**
+ * Setter for style.
+ *
+ * @param value style
+ */
+ public abstract void setStyle(String value);
+
+ /**
+ * Getter for popupStyle.
+ *
+ * HTML CSS style attribute of element for pop-up suggestion content
+ *
+ * @return popupStyle value from local variable or value bindings
+ */
+ public abstract String getPopupStyle();
+
+ /**
+ * Setter for popupStyle.
+ *
+ * @param value style
+ */
+ public abstract void setPopupStyle(String value);
+
}
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 2007-09-27
15:38:31 UTC (rev 3145)
+++
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-09-27
15:46:24 UTC (rev 3146)
@@ -45,8 +45,6 @@
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import javax.faces.el.MethodBinding;
-import javax.faces.event.FacesEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -181,10 +179,11 @@
suggestionBox.setRowIndex(-1);
writer.startElement(HTML.DIV_ELEM, component);
getUtils().encodeId(context, component);
- Map attributes = component.getAttributes();
StringBuffer clazz = new StringBuffer(
- "dr-sb-common-container rich-sb-common-container");
+ "dr-sb-common-container rich-sb-common-container ");
+ clazz.append(suggestionBox.getPopupClass() + " ").
+ append(suggestionBox.getStyleClass());
writer.writeAttribute("class", clazz, "popupClass");
int zIndex = suggestionBox.getZindex();
@@ -194,10 +193,8 @@
style.append(getSizeForStyle(component, "width", null, false));
style.append(getSizeForStyle(component, "height", null, false));
- Object popupStyle = attributes.get("popupStyle");
- if (null != popupStyle) {
- style.append(popupStyle);
- }
+ style.append(suggestionBox.getPopupStyle() + ";").
+ append(suggestionBox.getStyle() + ";");
writer.writeAttribute("style", style, "popupStyle");
UIComponent popupFacet = component.getFacet("popup");