Author: sergeyhalipov
Date: 2007-07-11 13:53:57 -0400 (Wed, 11 Jul 2007)
New Revision: 1600
Modified:
branches/3.0.2/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml
branches/3.0.2/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
branches/3.0.2/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-441
Modified:
branches/3.0.2/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
---
branches/3.0.2/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml 2007-07-11
15:12:41 UTC (rev 1599)
+++
branches/3.0.2/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml 2007-07-11
17:53:57 UTC (rev 1600)
@@ -68,7 +68,7 @@
<name>suggestionAction</name>
<classname>javax.faces.el.MethodBinding</classname>
<methodargs>
- java.lang.Object.class
+ java.lang.Object
</methodargs>
<description>
<![CDATA[Method calls an expression to get a collection of suggestion
data on request. It must have one parameter with a type of Object with content of input
component and must return any type allowed for <h:datatable> ]]>
Modified:
branches/3.0.2/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
---
branches/3.0.2/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-07-11
15:12:41 UTC (rev 1599)
+++
branches/3.0.2/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-07-11
17:53:57 UTC (rev 1600)
@@ -63,7 +63,7 @@
*/
private static final String[] OPTIONS = {"popupClass",
"popupStyle",
"width", "height", "entryClass",
"selectedClass", "param",
- "frequency", "minChars", "tokens",
"rows"};
+ "frequency", "minChars", "tokens",
"rows", "selectValueClass" };
/**
* Shadow depth.
Modified:
branches/3.0.2/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
---
branches/3.0.2/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-07-11
15:12:41 UTC (rev 1599)
+++
branches/3.0.2/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-07-11
17:53:57 UTC (rev 1600)
@@ -31,6 +31,8 @@
this.options.param = this.options.param || this.element.name;
this.options.selectedClass = this.options.selectedClass
|| "dr-sb-int-sel";
+ this.options.selectValueClass = this.options.selectValueClass
+ || " ";
this.options.tokens = $A(options.tokens) || [];
this.options.frequency = this.options.frequency || 0.4;
this.options.minChars = parseInt(this.options.minChars) || 1;
@@ -427,6 +429,12 @@
if (this.prevIndex != this.index) {
var entry = this.getEntry(this.index);
Element.addClassName(entry, this.options.selectedClass);
+
+ var cells =
document.getElementsByClassName("dr-sb-cell-padding" , entry);
+ for (var i = 0; i < cells.length; i++) {
+ Element.addClassName(cells[i], this.options.selectValueClass);
+ }
+
// Calc scroll position :
if (this.keyEvent) {
var scroll =
document.getElementsByClassName("_suggestion_size_", this.update)[0]
@@ -449,6 +457,10 @@
if (this.prevIndex >= 0) {
var prevEntry = this.getEntry(this.prevIndex);
if (prevEntry) {
+ var prevCells =
document.getElementsByClassName("dr-sb-cell-padding" , prevEntry);
+ for (var i = 0; i < prevCells.length; i++) {
+ Element.removeClassName(prevCells[i], this.options.selectValueClass);
+ }
Element.removeClassName(prevEntry, this.options.selectedClass);
}
}