Author: nbelaevski
Date: 2008-03-25 23:12:49 -0400 (Tue, 25 Mar 2008)
New Revision: 7239
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
Log:
http://jira.jboss.com/jira/browse/RF-2579
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
===================================================================
---
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2008-03-26
00:16:39 UTC (rev 7238)
+++
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2008-03-26
03:12:49 UTC (rev 7239)
@@ -13,6 +13,29 @@
Richfaces.SelectItem = Class.create();
+Richfaces.SelectItem.findElement = function(elt, id) {
+ var e = elt;
+
+ if (e) {
+ if (e.id == id) {
+ return e;
+ }
+
+ e = e.firstChild;
+ while (e) {
+ var result = arguments.callee(e, id);
+
+ if (result) {
+ return result;
+ }
+
+ e = e.nextSibling;
+ }
+ }
+
+ return null;
+};
+
Richfaces.SelectItem.prototype = {
initialize : function(label, id, node) {
this._label = label;
@@ -21,8 +44,8 @@
this._node.item = this;
this._id = id;
- //TODO 2 optimize
- this.input = $(node.id + "StateInput");
+ //XXX 2 optimize
+ this.input = Richfaces.SelectItem.findElement(node, node.id + "StateInput");
this.selected = /^s/.test(this.input.value);
this.active = /^s?a/.test(this.input.value);