Author: nbelaevski
Date: 2007-11-21 18:19:28 -0500 (Wed, 21 Nov 2007)
New Revision: 4161
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1395
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-21
23:19:14 UTC (rev 4160)
+++
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-21
23:19:28 UTC (rev 4161)
@@ -10,6 +10,9 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.component.UIDataAdaptor;
+import org.ajax4jsf.renderkit.ComponentVariables;
+import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIOrderingList;
import org.richfaces.component.UIOrderingList.ItemState;
@@ -24,6 +27,10 @@
public abstract class OrderingListRendererBase extends OrderingComponentRendererBase {
+ private static final String SELECTION_STATE_VAR_NAME = "selectionState";
+
+ private static final String ITEM_STATE_VAR_NAME = "itemState";
+
public OrderingListRendererBase() {
super(MESSAGE_BUNDLE_NAME);
}
@@ -179,53 +186,30 @@
return true;
}
- private static final ThreadLocal itemStates = new ThreadLocal();
-
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
- itemStates.set(((UIOrderingList) component).getItemState());
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this,
component);
+ variables.setVariable(ITEM_STATE_VAR_NAME, ((UIOrderingList)
component).getItemState());
+ variables.setVariable(SELECTION_STATE_VAR_NAME, new OrderingListSelectionState());
+
super.encodeBegin(context, component);
}
- public void encodeEnd(FacesContext context, UIComponent component)
- throws IOException {
- try {
- super.encodeEnd(context, component);
- } finally {
- itemStates.set(null);
- }
- }
-
public void encodeControlsFacets(FacesContext context, UIOrderingList orderingList)
throws IOException {
String clientId = orderingList.getClientId(context);
ResponseWriter writer = context.getResponseWriter();
- Object key = orderingList.getRowKey();
- boolean selectedFirst = false;
- boolean selectedLast = false;
-
- try {
- ItemState state = (ItemState) itemStates.get();
-
- orderingList.setRowKey(new Integer(0));
- selectedFirst = state.isSelected();
- orderingList.setRowKey(new Integer(orderingList.getModelSize() - 1));
- selectedLast = state.isSelected();
- } finally {
- try {
- orderingList.setRowKey(key);
- } catch (Exception e) {
- context.getExternalContext().log(e.getLocalizedMessage(), e);
- }
- }
-
//proper assumption about helpers ordering
int divider = HELPERS.length / 2;
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this,
orderingList);
+ OrderingListSelectionState selectionState = (OrderingListSelectionState)
variables.getVariable(SELECTION_STATE_VAR_NAME);
+
for (int i = 0; i < HELPERS.length; i++) {
- boolean enabled = i < divider ? !selectedFirst : !selectedLast;
- if (i % 2 == 0) {
+ boolean boundarySelection = i < divider ? selectionState.isFirstSelected() :
selectionState.isLastSelected();
+ boolean enabled = selectionState.isSelected() && !boundarySelection;
+ if (i % 2 == 1) {
enabled = !enabled;
}
@@ -237,6 +221,41 @@
}
}
+ private static final class OrderingListSelectionState {
+
+ private boolean firstSelected = false;
+ private boolean firstSelectedLatch = false;
+
+ private boolean selectedLatch = false;
+
+ private boolean lastSelected = false;
+
+ public void addState(boolean selected) {
+ if (!firstSelectedLatch) {
+ firstSelected = selected;
+ firstSelectedLatch = true;
+ }
+
+ if (selected) {
+ selectedLatch = true;
+ }
+
+ lastSelected = selected;
+ }
+
+ public boolean isFirstSelected() {
+ return firstSelected;
+ }
+
+ public boolean isSelected() {
+ return selectedLatch;
+ }
+
+ public boolean isLastSelected() {
+ return lastSelected;
+ }
+ };
+
public void encodeOneRow(FacesContext context, TableHolder holder)
throws IOException {
ResponseWriter writer = context.getResponseWriter();
@@ -248,17 +267,23 @@
StringBuffer rowClassName = new StringBuffer("ol_normal
rich-ordering-list-row");
StringBuffer cellClassName = new StringBuffer("ol_cell
rich-ordering-list-cell");
- ItemState state = (ItemState) itemStates.get();
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this, table);
+ ItemState state = (ItemState) variables.getVariable(ITEM_STATE_VAR_NAME);
+
if (state.isActive()) {
rowClassName.append(" ol_active rich-ordering-list-row-active");
cellClassName.append(" rich-ordering-list-cell-active");
}
- if (state.isSelected()) {
+ boolean selected = state.isSelected();
+ if (selected) {
rowClassName.append(" ol_select rich-ordering-list-row-selected");
cellClassName.append(" rich-ordering-list-cell-selected");
}
+
+ OrderingListSelectionState selectionState = (OrderingListSelectionState)
variables.getVariable(SELECTION_STATE_VAR_NAME);
+ selectionState.addState(selected);
writer.writeAttribute("class", rowClassName.toString(), null);
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-11-21
23:19:14 UTC (rev 4160)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-11-21
23:19:28 UTC (rev 4161)
@@ -19,24 +19,28 @@
LayoutManager.STYLE_CONTENTTD_PADDING = 4;
LayoutManager.prototype.widthSynchronization = function() {
- var contentCells = this.contentTable.tBodies[0].rows[0].cells;
- if (!this.headerTable || !this.headerTable.tHead)
- return ;
- var headerCells = this.headerTable.tHead.rows[0].cells;
- var width;
- for (var i = 0; i < contentCells.length; i++) {
- width = contentCells[i].offsetWidth - LayoutManager.STYLE_CONTENTTD_BORDER -
LayoutManager.STYLE_CONTENTTD_PADDING;
- if (i == contentCells.length - 1) {
- width = width + LayoutManager.SCROLL_WIDTH + "px";
- headerCells[i].firstChild.style.width = width;
- headerCells[i].style.width = width;
- } else {
- width = width + "px";
- headerCells[i].firstChild.style.width = width;
- headerCells[i].style.width = width;
+ var rows = this.contentTable.tBodies[0].rows;
+ if (rows && rows[0]) {
+ //table can be empty
+ var contentCells = rows[0].cells;
+ if (!this.headerTable || !this.headerTable.tHead)
+ return ;
+ var headerCells = this.headerTable.tHead.rows[0].cells;
+ var width;
+ for (var i = 0; i < contentCells.length; i++) {
+ width = contentCells[i].offsetWidth - LayoutManager.STYLE_CONTENTTD_BORDER -
LayoutManager.STYLE_CONTENTTD_PADDING;
+ if (i == contentCells.length - 1) {
+ width = width + LayoutManager.SCROLL_WIDTH + "px";
+ headerCells[i].firstChild.style.width = width;
+ headerCells[i].style.width = width;
+ } else {
+ width = width + "px";
+ headerCells[i].firstChild.style.width = width;
+ headerCells[i].style.width = width;
+ }
}
+ this.headerTable.style.width = this.contentTable.offsetWidth +
LayoutManager.SCROLL_WIDTH;
}
- this.headerTable.style.width = this.contentTable.offsetWidth +
LayoutManager.SCROLL_WIDTH;
}
LayoutManager.prototype.scrollHandler = function(obj) {
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-21
23:19:14 UTC (rev 4160)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-21
23:19:28 UTC (rev 4161)
@@ -8,7 +8,9 @@
}
-Shuttle = function(containerId, contentTableId, headerTableId, focusKeeperId,
valueKeeperId,
+Richfaces.OrderingList = Class.create();
+
+Richfaces.OrderingList.prototype.initialize = function(containerId, contentTableId,
headerTableId, focusKeeperId, valueKeeperId,
ids, onclickControlId, onorderchanged) {
this.container = document.getElementById(containerId);
this.shuttleTable = document.getElementById(contentTableId);
@@ -19,7 +21,7 @@
this.retrieveShuttleItems(containerId);
this.shuttle = null;
- this.sortOrder = Shuttle.ASC;
+ this.sortOrder = Richfaces.OrderingList.ASC;
this.activeItem = null;
@@ -43,38 +45,38 @@
Richfaces.disableSelectionText(this.container);
}
-Shuttle.ASC = "acs";
-Shuttle.DESC = "desc";
+Richfaces.OrderingList.ASC = "acs";
+Richfaces.OrderingList.DESC = "desc";
-Shuttle.CONTROL_SET = ["A", "INPUT", "TEXTAREA",
"SELECT", "BUTTON"];
+Richfaces.OrderingList.CONTROL_SET = ["A", "INPUT",
"TEXTAREA", "SELECT", "BUTTON"];
-Shuttle.ORDERING_LIST_CLASSES = {
+Richfaces.OrderingList.ORDERING_LIST_CLASSES = {
normal : "ol_internal_tab rich-ordering-list-items",
disabled : "ol_internal_tab rich-ordering-list-disabled",
active : "ol_internal_tab rich-ordering-list-active"
}
-Shuttle.ACTIVITY_MARKER = "a";
-Shuttle.SELECTION_MARKER = "s";
-Shuttle.ITEM_SEPARATOR = ",";
+Richfaces.OrderingList.ACTIVITY_MARKER = "a";
+Richfaces.OrderingList.SELECTION_MARKER = "s";
+Richfaces.OrderingList.ITEM_SEPARATOR = ",";
-Shuttle.HANDLERS = {
+Richfaces.OrderingList.HANDLERS = {
first: function (e) { this.moveSelectedItems("first", e);return false; },
last: function (e) { this.moveSelectedItems("last", e);return false; },
up: function (e) { this.moveSelectedItems("up", e);return false; },
down: function (e) { this.moveSelectedItems("down", e);return false; }
};
-Shuttle.prototype.init = function(containerId, contentTableId, headerTableId, ids,
onclickControlId) {
+Richfaces.OrderingList.prototype.init = function(containerId, contentTableId,
headerTableId, ids, onclickControlId) {
var obj = this;
this.setFocus();
- Shuttle.addEventListener(this.focusKeeper, "blur", function (e)
{obj.focusListener(e);});
+ Richfaces.OrderingList.addEventListener(this.focusKeeper, "blur", function (e)
{obj.focusListener(e);});
for (var i = 0; i < ids.length; i++) {
var id = ids[i];
var node = document.getElementById(containerId + id[0]);
var disNode = document.getElementById(containerId + id[1]);
if (node && disNode) {
- Shuttle.addClickListener(node, Shuttle.HANDLERS[id[0]].bindAsEventListener(this));
+ Richfaces.OrderingList.addClickListener(node,
Richfaces.OrderingList.HANDLERS[id[0]].bindAsEventListener(this));
this.controlList[i] = new Control(node, disNode, false, false, id[0]);
}
}
@@ -83,14 +85,14 @@
this.shuttleTop = LayoutManager.getElemXY(this.shuttleTable).top;
}
-Shuttle.prototype.isListActive = function() {
+Richfaces.OrderingList.prototype.isListActive = function() {
if ((this.activeItem != null || this.selectedItems.length != 0) &&
this.focusKeeper.focused) {
return true;
}
return false;
}
-Shuttle.prototype.controlListManager = function() {
+Richfaces.OrderingList.prototype.controlListManager = function() {
this.selectedItems.sort(this.compareByRowIndex);
var control;
//FIXME
@@ -105,7 +107,7 @@
}
}
-Shuttle.prototype.controlsProcessing = function(disabledControls) {
+Richfaces.OrderingList.prototype.controlsProcessing = function(disabledControls) {
for (var i = 0; i < this.controlList.length; i++) {
control = this.controlList[i];
if (control != null) {
@@ -115,7 +117,7 @@
}
}
-Shuttle.prototype.retrieveShuttleItems = function(containerId) {
+Richfaces.OrderingList.prototype.retrieveShuttleItems = function(containerId) {
var rows = this.shuttleTbody.rows;
this.shuttleItems = new Array();
var id;
@@ -135,18 +137,18 @@
}
}
-Shuttle.prototype.sort = function() {
- if (this.sortOrder == Shuttle.ASC) {
+Richfaces.OrderingList.prototype.sort = function() {
+ if (this.sortOrder == Richfaces.OrderingList.ASC) {
this.shuttleItems.sort(this.compareByLabel);
- this.sortOrder = Shuttle.DESC;
+ this.sortOrder = Richfaces.OrderingList.DESC;
} else {
this.shuttleItems.reverse();
- this.sortOrder = Shuttle.ASC;
+ this.sortOrder = Richfaces.OrderingList.ASC;
}
this.rebuild();
}
-Shuttle.prototype.moveSelectedItems = function(action, event) {
+Richfaces.OrderingList.prototype.moveSelectedItems = function(action, event) {
event = window.event||event;
var rows = this.shuttleTbody.rows;
var item;
@@ -195,7 +197,7 @@
}
}
-Shuttle.prototype.getExtremeItem = function(position) {
+Richfaces.OrderingList.prototype.getExtremeItem = function(position) {
var extremeItem = this.selectedItems[0];
var currentItem;
@@ -214,7 +216,7 @@
return extremeItem;
}
-Shuttle.prototype.getEventTargetRow = function(event) {
+Richfaces.OrderingList.prototype.getEventTargetRow = function(event) {
var activeElem;
if (event.rangeParent) {
//activeElem = event.rangeParent.parentNode;
@@ -227,7 +229,7 @@
return;
}
- if (activeElem.tagName && Shuttle.CONTROL_SET.indexOf(activeElem.tagName) != -1)
{
+ if (activeElem.tagName &&
Richfaces.OrderingList.CONTROL_SET.indexOf(activeElem.tagName) != -1) {
return;
}
@@ -241,7 +243,7 @@
return activeElem;
}
-Shuttle.prototype.onclickHandler = function(event) {
+Richfaces.OrderingList.prototype.onclickHandler = function(event) {
var activeElem = this.getEventTargetRow(event);
if (activeElem != null) {
@@ -266,7 +268,7 @@
}
}
-Shuttle.prototype.onkeydownHandler = function(event) {
+Richfaces.OrderingList.prototype.onkeydownHandler = function(event) {
var action = null;
switch (event.keyCode) {
case 34 : action = 'last'; this.moveSelectedItems(action ,event); break; //page
down
@@ -290,7 +292,7 @@
case 65 : // Ctrl + A
if (event.ctrlKey) {
this.selectAll();
- Shuttle.stopPropogation(event);
+ Richfaces.OrderingList.stopPropogation(event);
}
Richfaces.SelectItems.doActive(this.activeItem);
this.saveState();
@@ -301,7 +303,7 @@
// this.autoScrolling(action, event);
}
-Shuttle.stopPropogation = function(event) {
+Richfaces.OrderingList.stopPropogation = function(event) {
if (event.stopPropagation) {
event.preventDefault();
event.stopPropagation();
@@ -311,7 +313,7 @@
}
}
-Shuttle.prototype.invertSelection = function(event) {
+Richfaces.OrderingList.prototype.invertSelection = function(event) {
var eventItem = this.activeItem;
var eventShuttleItem = this.getSelectItemByNode(eventItem);
if (eventShuttleItem._selected) {
@@ -323,7 +325,7 @@
}
}
-Shuttle.prototype.moveActiveItem = function(action, event) {
+Richfaces.OrderingList.prototype.moveActiveItem = function(action, event) {
var item = this.activeItem;
var rows = this.shuttleTbody.rows;
if ((action == 'up') && (item.rowIndex > 0)) {
@@ -337,7 +339,7 @@
this.controlListManager();
}
-Shuttle.prototype.changeActiveItems = function(newItem, item) {
+Richfaces.OrderingList.prototype.changeActiveItems = function(newItem, item) {
var shuttleItem = this.getSelectItemByNode(item);
var newShuttleItem = this.getSelectItemByNode(newItem);
@@ -349,7 +351,7 @@
this.selectedItems.push(newItem);
}
-Shuttle.prototype.selectAll = function() {
+Richfaces.OrderingList.prototype.selectAll = function() {
var startIndex = 0;
var endIndex = this.shuttleItems.length - 1;
this.selectItemRange(startIndex, endIndex);
@@ -358,7 +360,7 @@
/**
* Click handler
*/
-Shuttle.prototype.selectionItem = function(activeItem) {
+Richfaces.OrderingList.prototype.selectionItem = function(activeItem) {
var markedItem = this.getSelectItemByNode(activeItem);
var markedShuttleItem = activeItem;
@@ -376,7 +378,7 @@
/**
* CTRL+Click handler
*/
-Shuttle.prototype.addSelectedItem = function(activeItem) {
+Richfaces.OrderingList.prototype.addSelectedItem = function(activeItem) {
var markedItem = this.getSelectItemByNode(activeItem);
var markedShuttleItem = activeItem;
@@ -398,7 +400,7 @@
/**
* Shift+Click handler
*/
-Shuttle.prototype.selectItemGroup = function(currentItem) {
+Richfaces.OrderingList.prototype.selectItemGroup = function(currentItem) {
//FIXME
var activeItemIndex = this.activeItem.rowIndex;
var startIndex;
@@ -417,7 +419,7 @@
this.selectItemRange(startIndex, endIndex);
}
-Shuttle.prototype.selectItemRange = function(startIndex, endIndex) {
+Richfaces.OrderingList.prototype.selectItemRange = function(startIndex, endIndex) {
var rows = this.shuttleTbody.rows;
for (var i = startIndex; i <= endIndex; i++) {
Richfaces.SelectItems.doSelect(rows[i]);
@@ -426,7 +428,7 @@
}
}
-Shuttle.prototype.resetMarked = function() {
+Richfaces.OrderingList.prototype.resetMarked = function() {
var rows = this.shuttleTbody.rows;
for (var i = 0; i < rows.length; i++) {
var shuttleItem = rows[i];
@@ -436,7 +438,7 @@
this.selectedItems.length = 0;
}
-Shuttle.prototype.getSelectItemByNode = function(selectItemNode) {
+Richfaces.OrderingList.prototype.getSelectItemByNode = function(selectItemNode) {
for (var i = 0; i < this.shuttleItems.length; i++) {
var item = this.shuttleItems[i];
if (selectItemNode.rowIndex == item._node.rowIndex) {
@@ -446,7 +448,7 @@
return null;
}
-Shuttle.prototype.autoScrolling = function(action, event) {
+Richfaces.OrderingList.prototype.autoScrolling = function(action, event) {
this.selectedItems.sort(this.compareByRowIndex);
var increment;
var scrollTop = this.shuttleTable.parentNode.scrollTop;
@@ -464,7 +466,7 @@
this.shuttleTable.parentNode.scrollTop += increment;
}
}
- Shuttle.stopPropogation(event);
+ Richfaces.OrderingList.stopPropogation(event);
}
/*Shuttle.prototype.init = function() {
@@ -514,55 +516,55 @@
selectItem._node = tr;
}*/
-Shuttle.prototype.toString = function() {
+Richfaces.OrderingList.prototype.toString = function() {
var result = new Array();
for (var i = 0; i < this.shuttleItems.length; i++) {
var item = this.shuttleItems[i];
result.push(item._id);
if (item._selected) {
- result.push(Shuttle.SELECTION_MARKER);
+ result.push(Richfaces.OrderingList.SELECTION_MARKER);
}
if (this.activeItem && (this.activeItem.rowIndex == item._node.rowIndex)) {
- result.push(Shuttle.ACTIVITY_MARKER);
+ result.push(Richfaces.OrderingList.ACTIVITY_MARKER);
}
if (i != (this.shuttleItems.length - 1)) {
- result.push(Shuttle.ITEM_SEPARATOR);
+ result.push(Richfaces.OrderingList.ITEM_SEPARATOR);
}
}
return result.join("");
}
-Shuttle.prototype.saveState = function() {
+Richfaces.OrderingList.prototype.saveState = function() {
if (this.activeItem != null || (this.selectedItems.length > 0)) {
this.valueKeeper.value = this.toString();
}
}
-Shuttle.prototype.compareByLabel = function(obj1, obj2) {
+Richfaces.OrderingList.prototype.compareByLabel = function(obj1, obj2) {
obj1 = obj1._label;
obj2 = obj2._label;
- return Shuttle.compare(obj1, obj2);
+ return Richfaces.OrderingList.compare(obj1, obj2);
}
-Shuttle.prototype.compareByRowIndex = function(obj1, obj2) {
+Richfaces.OrderingList.prototype.compareByRowIndex = function(obj1, obj2) {
obj1 = obj1.rowIndex;
obj2 = obj2.rowIndex;
- return Shuttle.compare(obj1, obj2);
+ return Richfaces.OrderingList.compare(obj1, obj2);
}
-Shuttle.compare = function(obj1, obj2) {
+Richfaces.OrderingList.compare = function(obj1, obj2) {
return ((obj1 == obj2) ? 0 : ((obj1 < obj2) ? -1 : 1));
}
-Shuttle.prototype.setFocus = function() {
+Richfaces.OrderingList.prototype.setFocus = function() {
this.focusKeeper.focus();
this.focusKeeper.focused = true;
if (this.isListActive()) {
- this.shuttleTable.className = Shuttle.ORDERING_LIST_CLASSES.active;
+ this.shuttleTable.className = Richfaces.OrderingList.ORDERING_LIST_CLASSES.active;
}
}
-Shuttle.prototype.focusListener = function(e) {
+Richfaces.OrderingList.prototype.focusListener = function(e) {
e = e || window.event;
this.focusKeeper.focusused = false;
if (this.activeItem != null) {
@@ -572,10 +574,10 @@
Richfaces.SelectItems.doNormal(this.activeItem);
}
}
- this.shuttleTable.className = Shuttle.ORDERING_LIST_CLASSES.normal;
+ this.shuttleTable.className = Richfaces.OrderingList.ORDERING_LIST_CLASSES.normal;
}
-Shuttle.addEventListener = function(elem, event, func) {
+Richfaces.OrderingList.addEventListener = function(elem, event, func) {
if (window.attachEvent) {
elem.attachEvent("on" + event, func);
} else {
@@ -583,7 +585,7 @@
}
}
-Shuttle.addClickListener = function(elem, func) {
- Shuttle.addEventListener(elem, "click", func);
+Richfaces.OrderingList.addClickListener = function(elem, func) {
+ Richfaces.OrderingList.addEventListener(elem, "click", func);
}
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2007-11-21
23:19:14 UTC (rev 4160)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2007-11-21
23:19:28 UTC (rev 4161)
@@ -59,7 +59,7 @@
},
compareStates : function(row, className) {
- if (row.className == className) {
+ if (row.className.indexOf(className) != -1) {
return true;
}
return false;
Modified:
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-21
23:19:14 UTC (rev 4160)
+++
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-21
23:19:28 UTC (rev 4161)
@@ -68,19 +68,13 @@
<f:clientId var="cId"/>
<script type="text/javascript">
var clientId = '#{cId}';
- Event.onReady(init);
-
-
- function init() {
- try {
+ Event.onReady(function() {
var cotrolsIdPrefix = [['up', 'disup'], ['down',
'disdown'], ['last', 'dislast'],
['first','disfirst']];
var shuttle = new Richfaces.OrderingList('#{cId}',
'#{cId}internal_tab', '#{cId}internal_header_tab',
'#{cId}focusKeeper', '#{cId}valueKeeper', cotrolsIdPrefix,
'#{cId}sortLabel', function()
{#{component.attributes['onorderchanged']}});
var layoutManager = new LayoutManager('#{clientId}internal_header_tab',
'#{clientId}internal_tab');
layoutManager.widthSynchronization();
- } catch (e) {
- alert(e);
- }
- }
+ });
+
//setTimeout(init, 0);
</script>
</div>