JBoss Rich Faces SVN: r4299 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-27 14:45:17 -0500 (Tue, 27 Nov 2007)
New Revision: 4299
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-1423
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-11-27 19:38:02 UTC (rev 4298)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-11-27 19:45:17 UTC (rev 4299)
@@ -451,7 +451,7 @@
}
},
- show: function(opts) {
+ show: function(event, opts) {
var element = $(this.id);
if(this.invokeEvent("show",event,null,element)){
this.preventFocus();
@@ -672,7 +672,7 @@
Selection.enableSelection(document.body);
},
- hide: function(opts) {
+ hide: function(event, opts) {
this.restoreFocus();
this.traverseSelects(true);
@@ -982,7 +982,7 @@
}
}
-Richfaces.showModalPanel = function (id, opts) {
+Richfaces.showModalPanel = function (id, opts, event) {
var invoke =
(RichFaces.MSIE == RichFaces.navigatorType()) ?
@@ -1007,16 +1007,16 @@
panel = Richfaces.findModalPanel(id);
}
invoke(function() {
- panel.component.show(opts);
+ panel.component.show(event, opts);
});
};
-Richfaces.hideModalPanel = function (id, opts) {
+Richfaces.hideModalPanel = function (id, opts, event) {
var panel = $(id);
if (!panel) {
panel = Richfaces.findModalPanel(id);
}
- panel.component.hide(opts);
+ panel.component.hide(event, opts);
};
17 years, 1 month
JBoss Rich Faces SVN: r4298 - branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-27 14:38:02 -0500 (Tue, 27 Nov 2007)
New Revision: 4298
Modified:
branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-1423
Modified: branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-11-27 19:37:56 UTC (rev 4297)
+++ branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-11-27 19:38:02 UTC (rev 4298)
@@ -419,7 +419,7 @@
}
},
- show: function(opts) {
+ show: function(event, opts) {
this.preventFocus();
var element = $(this.id);
@@ -639,7 +639,7 @@
}
},
- hide: function(opts) {
+ hide: function(event, opts) {
this.restoreFocus();
this.traverseSelects(true);
@@ -900,7 +900,7 @@
}
}
-Richfaces.showModalPanel = function (id, opts) {
+Richfaces.showModalPanel = function (id, opts, event) {
var invoke =
("MSIE" == RichFaces.navigatorType()) ?
@@ -925,16 +925,16 @@
panel = Richfaces.findModalPanel(id);
}
invoke(function() {
- panel.component.show(opts);
+ panel.component.show(event, opts);
});
};
-Richfaces.hideModalPanel = function (id, opts) {
+Richfaces.hideModalPanel = function (id, opts, event) {
var panel = $(id);
if (!panel) {
panel = Richfaces.findModalPanel(id);
}
- panel.component.hide(opts);
+ panel.component.hide(event, opts);
};
17 years, 1 month
JBoss Rich Faces SVN: r4297 - in branches/3.1.x/samples/modalpanel-sample: src/main/webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-27 14:37:56 -0500 (Tue, 27 Nov 2007)
New Revision: 4297
Modified:
branches/3.1.x/samples/modalpanel-sample/pom.xml
branches/3.1.x/samples/modalpanel-sample/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-1423
Modified: branches/3.1.x/samples/modalpanel-sample/pom.xml
===================================================================
--- branches/3.1.x/samples/modalpanel-sample/pom.xml 2007-11-27 19:31:13 UTC (rev 4296)
+++ branches/3.1.x/samples/modalpanel-sample/pom.xml 2007-11-27 19:37:56 UTC (rev 4297)
@@ -14,12 +14,17 @@
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>modal-panel</artifactId>
- <version>3.1.3-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>componentControl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.richfaces.samples</groupId>
<artifactId>skins</artifactId>
- <version>3.1.3-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
</dependencies>
<build>
Modified: branches/3.1.x/samples/modalpanel-sample/src/main/webapp/pages/index.jsp
===================================================================
--- branches/3.1.x/samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2007-11-27 19:31:13 UTC (rev 4296)
+++ branches/3.1.x/samples/modalpanel-sample/src/main/webapp/pages/index.jsp 2007-11-27 19:37:56 UTC (rev 4297)
@@ -9,6 +9,7 @@
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/modal-panel" prefix="mp" %>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/componentControl" prefix="cc" %>
<html>
<head>
@@ -148,115 +149,21 @@
<a href="javascript:Richfaces.showModalPanel(':_panel', {width: 1});">Show: width = 1</a>
</f:verbatim>
</h:panelGrid>
-
- <%--
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
+
+ <mp:modalPanel id="ccPanel" controlsClass="pointerCursor" onhide="alert(event.parameters.alertText)"
+ onshow="alert(event.parameters.alertText)">
+
+ <f:verbatim><a href="#" id="hideLink" onclick="return false;">Click text to hide modal panel!</a></f:verbatim>
</mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- <mp:modalPanel>
- <f:verbatim>
- Modal panel is here!
- </f:verbatim>
- </mp:modalPanel>
- --%>
+
+ <cc:componentControl attachTo="hideLink" event="onclick" for="ccPanel" operation="hide" params="alertText: 'Bye-bye!'" />
+ <a4j:outputPanel style="cursor: pointer;">
+ <cc:componentControl event="onclick" for="ccPanel" operation="show" params="alertText: 'Hello!'" />
+ <f:verbatim><h3>Click text to activate modal panel!</h3></f:verbatim>
+ </a4j:outputPanel>
+
+
<f:verbatim>
<div id="fatDiv" style="width: 20px; height: 20px;">div div div</div>
</f:verbatim>
17 years, 1 month
JBoss Rich Faces SVN: r4296 - branches/3.1.x/ui/componentControl/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-27 14:31:13 -0500 (Tue, 27 Nov 2007)
New Revision: 4296
Modified:
branches/3.1.x/ui/componentControl/src/main/config/component/componentControl.xml
Log:
parentProperties attribute removed
Modified: branches/3.1.x/ui/componentControl/src/main/config/component/componentControl.xml
===================================================================
--- branches/3.1.x/ui/componentControl/src/main/config/component/componentControl.xml 2007-11-27 18:50:13 UTC (rev 4295)
+++ branches/3.1.x/ui/componentControl/src/main/config/component/componentControl.xml 2007-11-27 19:31:13 UTC (rev 4296)
@@ -95,5 +95,9 @@
</description>
<defaultvalue>"immediate"</defaultvalue>
</property>
+
+ <property hidden="true">
+ <name>parentProperties</name>
+ </property>
</component>
</components>
17 years, 1 month
JBoss Rich Faces SVN: r4295 - branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-11-27 13:50:13 -0500 (Tue, 27 Nov 2007)
New Revision: 4295
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
Log:
Skinning for ordering list.
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-27 18:40:29 UTC (rev 4294)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2007-11-27 18:50:13 UTC (rev 4295)
@@ -10,11 +10,10 @@
NORMAL : "rich-ordering-list-row"
},
CELL : {
- ACTIVE : "ol_cell ol_cell_active rich-ordering-list-cell-active",
- SELECTED : "ol_cell ol_cell_selected rich-ordering-list-cell-selected",
- DISABLED : "ol_cell ol_cell_disabled rich-ordering-list-cell-disabled",
- NORMAL : "ol_cell ol_cell_normal rich-ordering-list-cell",
- LAST_CELL: "ol_endcol"
+ ACTIVE : "rich-ordering-list-cell-active",
+ SELECTED : "rich-ordering-list-cell-selected",
+ DISABLED : "rich-ordering-list-cell-disabled",
+ NORMAL : "rich-ordering-list-cell"
}
},
@@ -53,9 +52,7 @@
for (var i = 0; i < cells.length; i++) {
var cell = cells[i];
if (i == (cells.length - 1)) {
- var classes = classNameCell.split(' ');
- classes[0] = Richfaces.SelectItems.CLASSES.CELL.LAST_CELL;
- classNameCell = classes.join(' ');
+ Element.setStyle(cell, {'border': '0px'});
}
Richfaces.SelectItems.doChangeNode(cell, classNameCell);
}
17 years, 1 month
JBoss Rich Faces SVN: r4294 - in branches/3.1.x/ui/orderingList/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-27 13:40:29 -0500 (Tue, 27 Nov 2007)
New Revision: 4294
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
orderingList styles fixed
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-27 18:10:13 UTC (rev 4293)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-27 18:40:29 UTC (rev 4294)
@@ -90,7 +90,7 @@
border : 0px solid;
}
-.rich-ordering-list-output {
+.rich-ordering-list-output {
border : 1px solid;
margin : 0px 8px 8px 8px;
background: none repeat scroll 0% 50%;
@@ -243,17 +243,17 @@
<u:style name="font-size" skin="generalSizeFont" />
</u:selector>
- <u:selector name=".rich-ordering-list-items">
+ <u:selector name=".rich-ordering-list-items">
<u:style name="background-color" skin="generalBackgroundColor" />
<u:style name="border-color" skin="panelBorderColor" />
</u:selector>
- <u:selector name=".rich-ordering-list-output">
+ <u:selector name=".rich-ordering-list-output">
<u:style name="background-color" skin="generalBackgroundColor" />
<u:style name="border-color" skin="panelBorderColor" />
</u:selector>
- <u:selector name=".rich-ordering-list-cell">
+ <u:selector name=".rich-ordering-list-cell, .rich-ordering-list-cell *">
<u:style name="color" skin="generalTextColor"/>
<u:style name="font-family" skin="generalFamilyFont" />
<u:style name="font-size" skin="generalSizeFont" />
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-27 18:10:13 UTC (rev 4293)
+++ branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-27 18:40:29 UTC (rev 4294)
@@ -38,7 +38,7 @@
</tr>
<tr>
<td>
- <div id="#{clientId}headerBox" class="richorderinglist-output">
+ <div id="#{clientId}headerBox" class="rich-ordering-list-output">
<jsp:scriptlet><![CDATA[
String contentContainerStyle = "";
if (component.getAttributes().get("listWidth") != null) {
17 years, 1 month
JBoss Rich Faces SVN: r4293 - in branches/3.1.x/ui/orderingList/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-27 13:10:13 -0500 (Tue, 27 Nov 2007)
New Revision: 4293
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/ListBase.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/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
last changes for OL
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-27 16:43:53 UTC (rev 4292)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-11-27 18:10:13 UTC (rev 4293)
@@ -69,8 +69,9 @@
var tgtElemBorderWidth = LayoutManager.getBorderWidth(tgtElem, "lr");
var tgtElemPaddingWidth = LayoutManager.getPaddingWidth(tgtElem, "lr");
var tgtElemMarginWidth = LayoutManager.getMarginWidth(tgtElem, "lr");
-
+ //alert("srcElemBorderWidth:" + srcElemBorderWidth + "srcElemPaddingWidth:" + srcElemPaddingWidth + "srcElemMarginWidth:" + srcElemMarginWidth + "tgtElemBorderWidth:" + tgtElemBorderWidth + "tgtElemPaddingWidth:" + tgtElemPaddingWidth + "tgtElemMarginWidth:" + tgtElemMarginWidth);
var srcWidth = srcElem.offsetWidth - srcElemBorderWidth - srcElemPaddingWidth - srcElemMarginWidth;
+ //alert(tgtElem.style.width + "|" + srcElem.offsetWidth);
return {srcWidth : srcWidth, colWidth : (srcWidth + (srcElemBorderWidth - tgtElemBorderWidth)
+ (srcElemPaddingWidth - tgtElemPaddingWidth)
+ (srcElemMarginWidth - tgtElemMarginWidth))};
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-27 16:43:53 UTC (rev 4292)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-27 18:10:13 UTC (rev 4293)
@@ -1,4 +1,18 @@
if(!window.Richfaces) window.Richfaces = {};
+Richfaces.disableSelectionText = function(target) {
+ target.onselectstart = function(e) {
+ e = window.event||e;
+ if (e.srcElement) {
+ if (e.srcElement.tagName) {
+ var tagName = e.srcElement.tagName.toUpperCase();
+
+ if (tagName != "INPUT" && tagName != "TEXTAREA" /* any items more? */) {
+ return false;
+ }
+ }
+ }
+ }
+}
Richfaces.ListBase = Class.create();
@@ -22,8 +36,10 @@
onclickControlId) {
this.selectedItems = new Array();
+ //this.layoutManager = layoutManager;
this.container = $(containerId);
this.shuttleTable = $(contentTableId);
+ Richfaces.disableSelectionText(this.shuttleTable);
this.valueKeeper = $(valueKeeperId);
this.focusKeeper = $(focusKeeperId);
this.focusKeeper.focused = false;
@@ -127,6 +143,7 @@
Richfaces.SelectItems.doActive(this.activeItem);
this.setFocus();
+ //this.layoutManager.widthSynchronization();
}
},
@@ -176,6 +193,7 @@
}
this.autoScrolling(action, event);
+ //this.layoutManager.widthSynchronization();
},
changeActiveItems : function(newItem, item) {
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-27 16:43:53 UTC (rev 4292)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2007-11-27 18:10:13 UTC (rev 4293)
@@ -10,10 +10,11 @@
NORMAL : "rich-ordering-list-row"
},
CELL : {
- ACTIVE : "rich-ordering-list-cell-active",
- SELECTED : "rich-ordering-list-cell-selected",
- DISABLED : "rich-ordering-list-cell-disabled",
- NORMAL : "rich-ordering-list-cell"
+ ACTIVE : "ol_cell ol_cell_active rich-ordering-list-cell-active",
+ SELECTED : "ol_cell ol_cell_selected rich-ordering-list-cell-selected",
+ DISABLED : "ol_cell ol_cell_disabled rich-ordering-list-cell-disabled",
+ NORMAL : "ol_cell ol_cell_normal rich-ordering-list-cell",
+ LAST_CELL: "ol_endcol"
}
},
@@ -49,7 +50,13 @@
doChange : function(row, classNameRow, classNameCell) {
Richfaces.SelectItems.doChangeNode(row, classNameRow);
var cells = row.cells;
- for (var cell in cells) {
+ for (var i = 0; i < cells.length; i++) {
+ var cell = cells[i];
+ if (i == (cells.length - 1)) {
+ var classes = classNameCell.split(' ');
+ classes[0] = Richfaces.SelectItems.CLASSES.CELL.LAST_CELL;
+ classNameCell = classes.join(' ');
+ }
Richfaces.SelectItems.doChangeNode(cell, classNameCell);
}
},
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2007-11-27 16:43:53 UTC (rev 4292)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2007-11-27 18:10:13 UTC (rev 4293)
@@ -33,3 +33,4 @@
}
}
+
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-27 16:43:53 UTC (rev 4292)
+++ branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-27 18:10:13 UTC (rev 4293)
@@ -11,21 +11,21 @@
>
<h:styles>css/orderingList.xcss</h:styles>
- <h:scripts>
+ <h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
scripts/extend.js,
scripts/ShuttleUtils.js,
scripts/SelectItem.js,
scripts/LayoutManager.js
scripts/Control.js,
- scripts/ListBase.js,
- scripts/OrderingList.js
+ scripts/ListBase.js,
+ scripts/OrderingList.js
</h:scripts>
- <f:clientId var="clientId"/>
-
+ <f:clientId var="clientId"/>
+
<div id="#{clientId}" class="rich-ordering-list-ds" x:passThruWithExclusions="id,class">
- <input id="#{clientId}focusKeeper" type="button" value="" name="focusKeeper"
+ <input id="#{clientId}focusKeeper" type="button" value="" name="focusKeeper"
class="rich-ordering-list-fk" />
<input id="#{clientId}valueKeeper" type="hidden" name="#{clientId}" value="#{component.submittedString}"/>
@@ -38,26 +38,26 @@
</tr>
<tr>
<td>
- <div id="#{clientId}headerBox" class="rich-ordering-list-output">
- <jsp:scriptlet><![CDATA[
- String contentContainerStyle = "";
- if (component.getAttributes().get("listWidth") != null) {
- contentContainerStyle = contentContainerStyle.concat("width:").concat(component.getAttributes().get("listWidth").toString()).concat("px;");
- variables.setVariable("contentContainerStyle", contentContainerStyle);
- }
+ <div id="#{clientId}headerBox" class="richorderinglist-output">
+ <jsp:scriptlet><![CDATA[
+ String contentContainerStyle = "";
+ if (component.getAttributes().get("listWidth") != null) {
+ contentContainerStyle = contentContainerStyle.concat("width:").concat(component.getAttributes().get("listWidth").toString()).concat("px;");
+ variables.setVariable("contentContainerStyle", contentContainerStyle);
+ }
]]></jsp:scriptlet>
- <div class="rich-ordering-list-header" style="width: #{component.attributes['listWidth']}px;">
+ <div class="rich-ordering-list-header" style="#{contentContainerStyle}">
<table id="#{clientId}internal_header_tab" class="rich-ordering-list-items" cellpadding="0" cellspacing="0">
<f:call name="encodeHeader"/>
</table>
</div>
- <jsp:scriptlet><![CDATA[
- if (component.getAttributes().get("listHeight") != null) {
- contentContainerStyle = contentContainerStyle.concat("height:").concat(component.getAttributes().get("listHeight").toString()).concat("px;");
- variables.setVariable("contentContainerStyle", contentContainerStyle);
- }
- ]]></jsp:scriptlet>
- <div id="#{clientId}contentBox" class="rich-ordering-list-content" style="width: #{component.attributes['listWidth']}px; height:#{component.attributes['listHeight']}px;">
+ <jsp:scriptlet><![CDATA[
+ if (component.getAttributes().get("listHeight") != null) {
+ contentContainerStyle = contentContainerStyle.concat("height:").concat(component.getAttributes().get("listHeight").toString()).concat("px;");
+ variables.setVariable("contentContainerStyle", contentContainerStyle);
+ }
+ ]]></jsp:scriptlet>
+ <div id="#{clientId}contentBox" class="rich-ordering-list-content" style="#{contentContainerStyle}">
<table id="#{clientId}internal_tab" class="rich-ordering-list-items" cellpadding="0" cellspacing="0">
<tbody id="#{clientId}tbody">
<vcp:body>
17 years, 1 month
JBoss Rich Faces SVN: r4292 - in branches/3.1.x/ui/orderingList/src/main: java/org/richfaces/renderkit/html/gradientimages and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-11-27 11:43:53 -0500 (Tue, 27 Nov 2007)
New Revision: 4292
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
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/html/gradientimages/OrderingListClickedGradient.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListSelectGradient.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBase.java
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.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:
Skinning for ordering list:
http://jira.jboss.com/jira/browse/RF-1402
http://jira.jboss.com/jira/browse/RF-1401
http://jira.jboss.com/jira/browse/RF-1303
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java 2007-11-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java 2007-11-27 16:43:53 UTC (rev 4292)
@@ -55,8 +55,6 @@
private final static String ATTRIBUTE_CLASS_DISABLED_CONTROL = "disabledControlClass";
- private final static String STYLE_SKIN_CONTROL_BUTTON = "ol_button_control";
-
private final static String DIS_CONTROL_ID_PREFIX = "dis";
private final static String CONTROL_ID_UP = "up";
@@ -72,8 +70,8 @@
private final static String DEFAULT_LABEL_DOWN = "Down";
private final static String DEFAULT_LABEL_BOTTOM = "Last";
- private final static String ATTRIBUTE_CLASS_BUTTON = "ol_button";
- private final static String ATTRIBUTE_CLASS_BUTTON_DISABLED = "ol_button_disabled";
+ private final static String ATTRIBUTE_CLASS_BUTTON = "rich-ordering-list-button";
+ private final static String ATTRIBUTE_CLASS_BUTTON_DISABLED = "rich-ordering-list-button-disabled";
protected static final OrderingComponentRendererBase.ControlsHelper[] HELPERS = new OrderingComponentRendererBase.ControlsHelper[] {
new OrderingComponentRendererBase.ControlsHelper("top", "TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTop.class.getName(), FACET_TOP,
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-11-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-11-27 16:43:53 UTC (rev 4292)
@@ -139,10 +139,9 @@
this.bundleName = bundleName;
}
- public void encodeCaption(FacesContext context, UIComponent component)
- throws IOException {
- encodeCaption(context, component, OrderingComponentControlsHelper.FACET_CAPTION, "ol_label ol_out_label rich-ordering-list-caption");
-
+ public void encodeCaption(FacesContext context, UIComponent component) throws IOException {
+ encodeCaption(context, component, OrderingComponentControlsHelper.FACET_CAPTION,
+ "rich-ordering-list-caption");
}
protected void encodeCaption(FacesContext context, UIComponent component, String facetCaption, String captionStyle)
@@ -167,11 +166,11 @@
public void encodeHeader(FacesContext context, UIOrderingBaseComponent component)
throws IOException {
- encodeHeader(context, component, "rich-table-header", "ol_col rich-table-header-cell", "headerClass");
+ encodeHeader(context, component, "rich-ordering-list-table-header", "rich-ordering-list-table-header-cell", "headerClass");
}
- protected void encodeHeader(FacesContext context, UIOrderingBaseComponent component, String rowStyle,
- String styleCell, String headerClassAttr) throws IOException {
+ protected void encodeHeader(FacesContext context, UIOrderingBaseComponent component, String rowClass,
+ String cellClass, String headerClassAttr) throws IOException {
ResponseWriter writer = context.getResponseWriter();
//UIComponent header = orderingList.getHeader();
Iterator headers = component.columns();
@@ -181,8 +180,8 @@
String headerClass = (String) component.getAttributes().get(headerClassAttr);
writer.startElement("tr", component);
- encodeStyleClass(writer, null, rowStyle, null, headerClass);
- encodeHeaderFacets(context, writer, headers, styleCell, headerClass, "header", "th", component);
+ encodeStyleClass(writer, null, rowClass, null, headerClass);
+ encodeHeaderFacets(context, writer, headers, cellClass, headerClass, "header", "th", component);
writer.endElement("tr");
@@ -211,8 +210,7 @@
writer.startElement(HTML.DIV_ELEM, orderingList);
writer.writeAttribute(HTML.id_ATTRIBUTE, clientId + helper.getIdSuffix(), null); //FIXME:
- writer.writeAttribute(HTML.class_ATTRIBUTE, "ol_button_border " + currentStyle, null);
- //HTML.class_ATTRIBUTE, "ol_button_border " + (enabled ? "ol_control_shown" : "ol_control_hidden") + currentStyle
+ writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
String style = null;
if (enabled) {
style = "display:block;";
@@ -225,14 +223,14 @@
writer.startElement(HTML.DIV_ELEM, orderingList);
writer.writeAttribute(HTML.class_ATTRIBUTE, helper.getButtonStyleClass(), null);
if (helper.enable) {
- writer.writeAttribute(HTML.onmouseover_ATTRIBUTE, "this.className='ol_button_light'", null);
- writer.writeAttribute(HTML.onmousedown_ATTRIBUTE, "this.className='ol_button_press'", null);
- writer.writeAttribute(HTML.onmouseup_ATTRIBUTE, "this.className='ol_button'", null);
- writer.writeAttribute(HTML.onmouseout_ATTRIBUTE, "this.className='ol_button'", null);
+ writer.writeAttribute(HTML.onmouseover_ATTRIBUTE, "this.className='rich-ordering-list-button-light'", null);
+ writer.writeAttribute(HTML.onmousedown_ATTRIBUTE, "this.className='rich-ordering-list-button-press'", null);
+ writer.writeAttribute(HTML.onmouseup_ATTRIBUTE, "this.className='rich-ordering-list-button'", null);
+ writer.writeAttribute(HTML.onmouseout_ATTRIBUTE, "this.className='rich-ordering-list-button'", null);
}
writer.startElement(HTML.DIV_ELEM, orderingList);
- writer.writeAttribute(HTML.class_ATTRIBUTE, "ol_button_content", null);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, "rich-ordering-list-button-content", null);
}
@@ -296,7 +294,7 @@
writer.startElement(element, column);
if (!headers.hasNext()) {
- skinCellClass = "ol_endcol rich-table-header-cell-end";
+ skinCellClass = "rich-ordering-list-table-header-cell-end";
}
encodeStyleClass(writer, null, skinCellClass, headerClass, columnHeaderClass);
getUtils().encodeAttribute(context, column, "colspan");
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-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-27 16:43:53 UTC (rev 4292)
@@ -131,21 +131,21 @@
writer.startElement(HTML.TR_ELEMENT, table);
writer.writeAttribute("id", clientId, null);
- StringBuffer rowClassName = new StringBuffer("ol_normal rich-ordering-list-row");
- StringBuffer cellClassName = new StringBuffer("ol_cell rich-ordering-list-cell");
+ StringBuffer rowClassName = new StringBuffer("rich-ordering-list-row");
+ StringBuffer cellClassName = new StringBuffer("rich-ordering-list-cell");
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");
+ rowClassName.append(" rich-ordering-list-row-active");
cellClassName.append(" rich-ordering-list-cell-active");
}
boolean selected = state.isSelected();
if (selected) {
- rowClassName.append(" ol_select rich-ordering-list-row-selected");
+ rowClassName.append(" rich-ordering-list-row-selected");
cellClassName.append(" rich-ordering-list-cell-selected");
}
@@ -164,7 +164,7 @@
writer.startElement(HTML.td_ELEM, table);
if (!iterator.hasNext()) {
- cellClassName.insert(7, " ol_endcol ");
+ cellClassName.append(" rich-ordering-list-cell-end");
}
writer.writeAttribute("class", cellClassName.toString(), null);
renderChildren(context, column);
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java 2007-11-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java 2007-11-27 16:43:53 UTC (rev 4292)
@@ -39,7 +39,7 @@
}
public OrderingListClickedGradient() {
- super(7, 15, 9, "headerGradientColor", Skin.headerBackgroundColor);
+ super(7, 15, 9, Skin.generalBackgroundColor, "tabBackgroundColor");
}
}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java 2007-11-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java 2007-11-27 16:43:53 UTC (rev 4292)
@@ -30,6 +30,6 @@
*/
public class OrderingListHeaderGradient extends BaseGradient {
public OrderingListHeaderGradient() {
- super(8, 18, 9, "headerGradientColor", Skin.headerBackgroundColor);
+ super(8, 18, 9, Skin.generalBackgroundColor, "tabBackgroundColor");
}
}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListSelectGradient.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListSelectGradient.java 2007-11-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListSelectGradient.java 2007-11-27 16:43:53 UTC (rev 4292)
@@ -29,6 +29,6 @@
*/
public class OrderingListSelectGradient extends BaseGradient {
public OrderingListSelectGradient() {
- super(11, 18, "headerGradientColor", "additionalBackgroundColor");
+ super(11, 18, 18, "additionalBackgroundColor", "headerGradientColor");
}
}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBase.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBase.java 2007-11-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBase.java 2007-11-27 16:43:53 UTC (rev 4292)
@@ -46,13 +46,13 @@
private static final Dimension DIMENSION = new Dimension(15, 15);
- protected static final String ICON_COLOR = "headerTextColor";
- protected static final String BACKGROUND_COLOR = "headerBackgroundColor";
- protected static final String BORDER_COLOR = "subBorderColor";
+ protected static final String ICON_COLOR = "generalTextColor";
+ protected static final String BACKGROUND_COLOR = "tabBackgroundColor";
+ protected static final String BORDER_COLOR = "generalBackgroundColor";
protected static final String DISABLED_ICON_COLOR = "tabDisabledTextColor";
protected static final String DISABLED_BACKGROUND_COLOR = "tabBackgroundColor";
- protected static final String DISABLED_BORDER_COLOR = "subBorderColor";
+ protected static final String DISABLED_BORDER_COLOR = "generalBackgroundColor";
public OrderingListIconBase() {
setRenderer(new GifRenderer());
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-27 16:43:53 UTC (rev 4292)
@@ -5,242 +5,303 @@
<f:verbatim><![CDATA[
+.rich-ordering-control-disabled {
+ border : 1px solid;
+ margin-bottom : 3px;
+}
-.ol_button_layout{padding : 15px 8px 15px 0px;}
-.ol_button_border{border : 1px solid #bfbfc0; margin-bottom : 3px;}
+.rich-ordering-control-top {
+ border : 1px solid;
+ margin-bottom : 3px;
+}
-.ol_button {
- background : top left #C6D6EA repeat-x;
+.rich-ordering-control-bottom {
+ border : 1px solid;
+ margin-bottom : 3px;
+}
+
+.rich-ordering-control-up {
+ border : 1px solid;
+ margin-bottom : 3px;
+}
+
+.rich-ordering-control-down {
+ border : 1px solid;
+ margin-bottom : 3px;
+}
+
+.rich-ordering-list-button {
+ background : top left repeat-x;
cursor : pointer;
padding : 2px;
- font-family : Arial; font-size :11px;
}
-.ol_button_disabled {
- background : top left #C6D6EA repeat-x;
+.rich-ordering-list-button-disabled {
+ background : top left repeat-x;
padding : 2px;
- font-family : Arial; font-size :11px;
}
-.ol_button_light{background : top left #C6D6EA repeat-x; border : 1px solid #E79A00;cursor : pointer; padding : 1px; font-family : Arial; font-size :11px;}
-.ol_button_dis{background : #bfbfc0; border : 1px solid #bfbfc0; margin-bottom : 3px; padding : 1px}
-.ol_button_press{background : top left repeat-x #EAF0F8; border : 1px solid #E79A00; padding : 2px 0px 0px 2px;font-family : Arial; font-size :11px;}
-.ol_center_button_col_valign{vertical-align : middle}
-.ol_right_button_col_valign{vertical-align : middle}
+.rich-ordering-list-button-light {
+ background : top left repeat-x;
+ border-style: solid;
+ cursor : pointer;
+ padding: 1px;
+}
-.ol_button_content {
- font-family : Arial;
- font-size :11px;
+/*
+.rich-ordering-list-button-dis {
+ border : 1px solid #bfbfc0;
+ margin-bottom : 3px;
+ padding : 1px
+}
+*/
+
+.rich-ordering-list-button-press {
+ background : top left repeat-x;
+ border-style: solid;
+ padding : 2px 0px 0px 2px;
+}
+
+.rich-ordering-list-button-valign {
+ vertical-align : middle;
+}
+
+.rich-ordering-list-button-layout {
+ padding : 15px 8px 15px 0px;
+}
+
+.rich-ordering-list-button-content {
padding : 0px 4px 0px 1px;
text-align : left;
white-space: nowrap;
}
-.ol_button_content img {
+.rich-ordering-list-button-content img {
margin-right: 2px;
vertical-align: middle;
}
-
-/*
-.ol_button_clicked {
- background : repeat scroll left top;
- border : 1px solid #bfbfc0;
- margin-bottom : 3px;
- cursor : pointer;
- padding : 1px;
-}
-.ol_button_dis {
- background : #bfbfc0;
- border : 1px solid #bfbfc0;
- margin-bottom : 3px;
- padding : 1px;
+.rich-ordering-list-caption {
+ height: 8px;
+ padding : 3px 3px 3px 8px
}
-.ol_button_press {
- background : #4A75B5;
- border : 1px solid #bfbfc0;
- margin-bottom : 3px;
- padding : 2px 0px 0px 2px;
+.rich-ordering-list-body {
+ border : 0px solid;
}
-*/
-.ol_caption {
- padding : 1px;
- height: 8px;
+.rich-ordering-list-output {
+ border : 1px solid;
+ margin : 0px 8px 8px 8px;
+ background: none repeat scroll 0% 50%;
}
-.ol_body{border : 0px solid #bfbfc0;}
-
-.ol_label{font-family : Arial; font-size :11px; font-weight : bold;}
-
-.ol_out_label{padding : 3px 3px 3px 8px}
-
-.ol_list{background : #FFFFFF; border : 1px solid #bfbfc0;}
-
-.ol_outputlist{ margin : 0px 8px 8px 8px;}
-
-.ol_list_content {
- /*overflow-y : scroll;
- overflow-x: auto;*/
+.rich-ordering-list-content {
overflow: auto;
- /*width: 200px;
- height: 150px;*/
}
-.ol_list_header {
+.rich-ordering-list-header {
overflow: hidden;
- /*width: 300px;*/
height: 18px;
}
-.ol_internal_header_tab {
+.rich-ordering-list-items {
background : repeat scroll left top;
- /*width : 100%;*/
+ width: 100%;
}
-.ol_internal_header_tab th{background : none top left repeat-x #C6D6EA; color : #000000; font-family : Arial; font-size :11px; font-weight : normal; border-bottom : 1px solid #bfbfc0;border-right : 1px solid #bfbfc0;border-left : 1px solid #EAF0F8;border-top : 1px solid #FFFFFF; padding : 2px}
+.rich-ordering-list-active {
+ background : repeat scroll left top;
+ width: 100%;
+}
-.ol_internal_header_tab .ol_endcol {
- border-right : 0px;
- white-space: nowrap;
+.rich-ordering-list-disabled {
+ background : repeat scroll left top;
+ width: 100%;
}
-.ol_internal_tab {
- width : 100%;
+.rich-ordering-list-row-active {
+ background : transparent none repeat-x scroll left top;
+ width: 100%;
}
-.ol_internal_tab .ol_endcol{border-right : 0px;}
+.rich-ordering-list-row-selected {
+ background : transparent none repeat-x scroll left top;
+ width: 100%;
+}
-.ol_internal_tab td{font-family : Arial; font-size :11px; padding : 2px;border-right : 1px solid #FFFFFF; border-left : 1px solid #FFFFFF;}
-
-.ol_internal_tab .ol_endcol{border-right : 0px;}
-
-.ol_internal_tab tr.ol_select{background : #EAF0F8}
-
-.ol_internal_tab tr.ol_active {
- /*background : #EAF0F8; color : #4A75B5;*/
+.rich-ordering-list-table-header-cell {
+ background : none top left repeat-x;
+ border-style: solid;
+ padding : 2px;
}
-.ol_internal_tab tr.ol_active * {
- font-weight: bold;
- /*color : #4A75B5;*/
+.rich-ordering-list-table-header-cell-end {
+ border-right : 0px;
+ white-space: nowrap;
}
-.ol_internal_tab tr.ol_normal {
+.rich-ordering-list-cell-end {
+ border-right : 0px;
+ white-space: nowrap;
}
-.ol_control_shown {
- /*visibility: visible;*/
- display: block;
+.rich-ordering-list-cell {
+ padding : 2px;
+ white-space: nowrap;
}
-.ol_control_hidden {
- /*visibility: hidden;*/
- display: none;
-}
-.disableSelection {
+.rich-ordering-list-ds {
-moz-user-select: -moz-none;
}
-.disableSelection input {
+.rich-ordering-list-fk {
+ width: 1px;
+ position: absolute;
+ left: -32767px;
+}
+
+.rich-ordering-list-ds input {
-moz-user-select: text;
}
]]>
</f:verbatim>
-<u:selector name=".ol_cell, .ol_cell *">
- <u:style name="color" skin="generalTextColor"/>
- <u:style name="font-size" skin="generalSizeFont"/>
- <u:style name="font-family" skin="generalFamilyFont"/>
- <u:style name="white-space" value="nowrap"/>
-</u:selector>
-<u:selector name=".ol_control_bn_up">
+<u:selector name=".rich-ordering-list-button">
<u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconUp" />
- </u:style>
-</u:selector>
-<u:selector name=".ol_control_bn_down">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconDown" />
- </u:style>
-</u:selector>
-<u:selector name=".ol_control_bn_top">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconTop" />
- </u:style>
-</u:selector>
-<u:selector name=".ol_control_bn_bottom">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconBottom" />
- </u:style>
-</u:selector>
-<u:selector name=".ol_control_dbn_up">
- <u:style name="disabled" value="true"/>
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconUpDisabled" />
- </u:style>
-</u:selector>
-<u:selector name=".ol_control_dbn_down">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconDownDisabled" />
- </u:style>
-</u:selector>
-<u:selector name=".ol_control_dbn_top">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconTopDisabled" />
- </u:style>
-</u:selector>
-<u:selector name=".ol_control_dbn_bottom">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled" />
- </u:style>
-</u:selector>
-
-<u:selector name=".ol_button">
- <u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
</u:style>
- <u:style name="background-color" skin="headerBackgroundColor" />
+ <u:style name="background-color" skin="tabBackgroundColor" />
+ <u:style name="color" skin="generalTextColor"/>
+ <u:style name="font-family" skin="headerFamilyFont"/>
+ <u:style name="font-size" skin="headerSizeFont"/>
</u:selector>
-<u:selector name=".ol_button_disabled">
+<u:selector name=".rich-ordering-list-button-disabled">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
</u:style>
- <u:style name="background-color" skin="headerBackgroundColor" />
+ <u:style name="background-color" skin="tabBackgroundColor" />
<u:style name="color" skin="tabDisabledTextColor"/>
+ <u:style name="font-family" skin="headerFamilyFont"/>
+ <u:style name="font-size" skin="headerSizeFont"/>
</u:selector>
-<u:selector name=".ol_button_light">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
- </u:style>
- <u:style name="background-color" skin="headerBackgroundColor" />
-</u:selector>
+ <u:selector name=".rich-ordering-list-button-light">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
+ </u:style>
+ <u:style name="background-color" skin="tabBackgroundColor" />
+ <u:style name="border-color" skin="tableBorderColor" />
+ <u:style name="border-width" skin="tableBorderWidth" />
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ <u:style name="color" skin="generalTextColor"/>
+ </u:selector>
-<u:selector name=".ol_button_press">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient" />
- </u:style>
- <u:style name="background-color" skin="headerGradientColor" />
-</u:selector>
+ <u:selector name=".rich-ordering-list-button-press">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient" />
+ </u:style>
+ <u:style name="background-color" skin="generalBackgroundColor" />
+ <u:style name="border-color" skin="tableBorderColor" />
+ <u:style name="border-width" skin="tableBorderWidth" />
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ <u:style name="color" skin="generalTextColor"/>
+ </u:selector>
-<u:selector name=".ol_internal_header_tab th">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
- </u:style>
- <u:style name="background-color" skin="headerBackgroundColor" />
-</u:selector>
+ <u:selector name=".rich-ordering-list-table-header-cell">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
+ </u:style>
+ <u:style name="background-color" skin="headerBackgroundColor" />
+ <u:style name="color" skin="headerTextColor" />
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ <u:style name="font-weight" skin="headerWeightFont" />
+ <u:style name="border-width" skin="tableBorderWidth" />
+ <u:style name="border-top-color" skin="subBorderColor" />
+ <u:style name="border-bottom-color" skin="tableBorderColor" />
+ <u:style name="border-right-color" skin="tableBorderColor" />
+ <u:style name="border-left-color" skin="panelBorderColor" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-list-table-header-cell-end">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
+ </u:style>
+ <u:style name="background-color" skin="headerBackgroundColor" />
+ <u:style name="color" skin="headerTextColor" />
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ <u:style name="font-weight" skin="headerWeightFont" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-list-cell-end">
+ <u:style name="font-family" skin="generalFamilyFont" />
+ <u:style name="font-size" skin="generalSizeFont" />
+ </u:selector>
-<u:selector name=".ol_internal_tab tr.ol_select">
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListSelectGradient" />
- </u:style>
- <u:style name="background-color" skin="additionalBackgroundColor" />
-</u:selector>
-
-<u:selector name=".ol_internal_tab tr.ol_active">
- <u:style name="font-weight" value="bold" />
-</u:selector>
+ <u:selector name=".rich-ordering-list-items">
+ <u:style name="background-color" skin="generalBackgroundColor" />
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-list-output">
+ <u:style name="background-color" skin="generalBackgroundColor" />
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-list-cell">
+ <u:style name="color" skin="generalTextColor"/>
+ <u:style name="font-family" skin="generalFamilyFont" />
+ <u:style name="font-size" skin="generalSizeFont" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-control-disabled">
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+ <u:selector name=".rich-ordering-control-top">
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+ <u:selector name=".rich-ordering-control-bottom">
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+ <u:selector name=".rich-ordering-control-up">
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+ <u:selector name=".rich-ordering-control-down">
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-list-button-content">
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-list-caption">
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ <u:style name="font-weight" skin="headerWeightFont" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-list-row-active">
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ <u:style name="font-weight" skin="headerWeightFont" />
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListSelectGradient" />
+ </u:style>
+ <u:style name="background-color" skin="headerGradientColor" />
+ </u:selector>
+
+ <u:selector name=".rich-ordering-list-row-selected">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListSelectGradient" />
+ </u:style>
+ <u:style name="background-color" skin="headerGradientColor" />
+ </u:selector>
+}
+
</f:template>
\ No newline at end of file
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-27 16:43:53 UTC (rev 4292)
@@ -7,9 +7,9 @@
}
Richfaces.ListBase.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"
+ normal : "rich-ordering-list-items",
+ disabled : "rich-ordering-list-disabled",
+ active : "rich-ordering-list-active"
}
Richfaces.ListBase.ASC = "acs";
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-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2007-11-27 16:43:53 UTC (rev 4292)
@@ -4,10 +4,10 @@
Richfaces.SelectItems = {
CLASSES : {
ROW : {
- ACTIVE : "ol_active rich-ordering-list-row-active",
- SELECTED : "ol_select rich-ordering-list-row-selected",
+ ACTIVE : "rich-ordering-list-row-active",
+ SELECTED : "rich-ordering-list-row-selected",
DISABLED : "rich-ordering-list-row-disabled",
- NORMAL : "ol_normal rich-ordering-list-row"
+ NORMAL : "rich-ordering-list-row"
},
CELL : {
ACTIVE : "rich-ordering-list-cell-active",
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-27 16:36:10 UTC (rev 4291)
+++ branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-27 16:43:53 UTC (rev 4292)
@@ -24,40 +24,41 @@
<f:clientId var="clientId"/>
- <div id="#{clientId}" class="disableSelection" x:passThruWithExclusions="id,class">
- <input id="#{clientId}focusKeeper" type="button" value="" style="width: 1px; position: absolute; left: -32767px;" name="focusKeeper"/>
+ <div id="#{clientId}" class="rich-ordering-list-ds" x:passThruWithExclusions="id,class">
+ <input id="#{clientId}focusKeeper" type="button" value="" name="focusKeeper"
+ class="rich-ordering-list-fk" />
<input id="#{clientId}valueKeeper" type="hidden" name="#{clientId}" value="#{component.submittedString}"/>
- <table id="#{clientId}table" cellpadding="0" cellspacing="0" class="ol_body">
+ <table id="#{clientId}table" cellpadding="0" cellspacing="0" class="rich-ordering-list-body">
<tbody>
<tr>
- <td colspan="2" class="ol_caption">
+ <td colspan="2" class="rich-ordering-list-caption">
<f:call name="encodeCaption"/>
</td>
</tr>
<tr>
<td>
- <div id="#{clientId}headerBox" class="ol_list ol_outputlist">
- <jsp:scriptlet><![CDATA[
- String contentContainerStyle = "";
- if (component.getAttributes().get("listWidth") != null) {
- contentContainerStyle = contentContainerStyle.concat("width:").concat(component.getAttributes().get("listWidth").toString()).concat("px;");
- variables.setVariable("contentContainerStyle", contentContainerStyle);
- }
+ <div id="#{clientId}headerBox" class="rich-ordering-list-output">
+ <jsp:scriptlet><![CDATA[
+ String contentContainerStyle = "";
+ if (component.getAttributes().get("listWidth") != null) {
+ contentContainerStyle = contentContainerStyle.concat("width:").concat(component.getAttributes().get("listWidth").toString()).concat("px;");
+ variables.setVariable("contentContainerStyle", contentContainerStyle);
+ }
]]></jsp:scriptlet>
- <div class="ol_list_header" style="#{contentContainerStyle}">
- <table id="#{clientId}internal_header_tab" class="ol_internal_header_tab rich-ordering-list-items" cellpadding="0" cellspacing="0">
+ <div class="rich-ordering-list-header" style="width: #{component.attributes['listWidth']}px;">
+ <table id="#{clientId}internal_header_tab" class="rich-ordering-list-items" cellpadding="0" cellspacing="0">
<f:call name="encodeHeader"/>
</table>
</div>
- <jsp:scriptlet><![CDATA[
- if (component.getAttributes().get("listHeight") != null) {
- contentContainerStyle = contentContainerStyle.concat("height:").concat(component.getAttributes().get("listHeight").toString()).concat("px;");
- variables.setVariable("contentContainerStyle", contentContainerStyle);
- }
- ]]></jsp:scriptlet>
- <div id="#{clientId}contentBox" class="ol_list_content" style="#{contentContainerStyle}">
- <table id="#{clientId}internal_tab" class="ol_internal_tab" cellpadding="0" cellspacing="0">
+ <jsp:scriptlet><![CDATA[
+ if (component.getAttributes().get("listHeight") != null) {
+ contentContainerStyle = contentContainerStyle.concat("height:").concat(component.getAttributes().get("listHeight").toString()).concat("px;");
+ variables.setVariable("contentContainerStyle", contentContainerStyle);
+ }
+ ]]></jsp:scriptlet>
+ <div id="#{clientId}contentBox" class="rich-ordering-list-content" style="width: #{component.attributes['listWidth']}px; height:#{component.attributes['listHeight']}px;">
+ <table id="#{clientId}internal_tab" class="rich-ordering-list-items" cellpadding="0" cellspacing="0">
<tbody id="#{clientId}tbody">
<vcp:body>
<f:call name="encodeRows" />
@@ -67,8 +68,8 @@
</div>
</div>
</td>
- <td class="ol_center_button_col_valign">
- <div class="ol_button_layout">
+ <td class="rich-ordering-list-button-valign">
+ <div class="rich-ordering-list-button-layout">
<f:call name="encodeControlsFacets" />
</div>
<f:clientId var="clientId"/>
17 years, 1 month
JBoss Rich Faces SVN: r4291 - trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-11-27 11:36:10 -0500 (Tue, 27 Nov 2007)
New Revision: 4291
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
Log:
RF-1334
Modified: trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
--- trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-11-27 16:26:36 UTC (rev 4290)
+++ trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-11-27 16:36:10 UTC (rev 4291)
@@ -94,7 +94,7 @@
break;
}
}
- Event.observe(this.container.getElement(), 'scroll', this.synchronizeHScroll.bindAsEventListener(this));
+ Event.observe(this.container.getElement(), 'keypress', this.synchronizeScroll.bindAsEventListener(this));
// create scroll box
this.scrollBox = new ClientUI.common.box.ScrollableBox(this.gridId + ":scb", this.getElement());
@@ -121,7 +121,7 @@
this.contentBox = new ClientUI.common.box.Box(normal);
this.contentBox.makeAbsolute();
- Event.observe(this.contentBox.getElement(), 'scroll', this.synchronizeVScroll.bindAsEventListener(this));
+ Event.observe(this.contentBox.getElement(), 'keypress', this.synchronizeScroll.bindAsEventListener(this));
this.frozenContentBox = new ClientUI.common.box.Box(frozen);
this.frozenContentBox.makeAbsolute();
@@ -812,11 +812,9 @@
}
},
- synchronizeHScroll: function() {
- this.container.getElement().scrollLeft = 0;
- },
-
- synchronizeVScroll: function() {
- this.contentBox.getElement().scrollTop = 0;
+ synchronizeScroll: function(event) {
+ if(Event.KEY_TAB == event.keyCode || Event.KEY_TAB == event.charCode) {
+ Event.stop(event);
+ }
}
});
17 years, 1 month
JBoss Rich Faces SVN: r4290 - trunk/docs/faq/en/src/main/docbook/module.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2007-11-27 11:26:36 -0500 (Tue, 27 Nov 2007)
New Revision: 4290
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
Log:
RF-1422 - fix 'How to get row selection in scrollableDataTable using one and multi-selection rows mode?' section in FAQ
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2007-11-27 16:25:02 UTC (rev 4289)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2007-11-27 16:26:36 UTC (rev 4290)
@@ -368,14 +368,15 @@
<section>
<?dbhtml filename="HowtocustomizesimpleTogglePanel.html"?>
<title>How to pass own parameters during a modalPanel opening or closing?</title>
- <para> You can pass your parameters during modalPanel opening or closing. This passing could be
- performed in the following way: </para>
-
+ <para> You can pass your parameters during modalPanel opening or closing. This
+ passing could be performed in the following way: </para>
+
<para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="JAVA"><![CDATA[Richfaces.showModalPanel('panelId', {left: auto}, {param1: value1});]]></programlisting>
- <para> Thus, except the standard modalPanel parameters you can pass any of your own parameters. </para>
+ <para> Thus, except the standard modalPanel parameters you can pass any of your own
+ parameters. </para>
</section>
<section>
@@ -756,8 +757,8 @@
<section id="DecidingWhatToChangeOnTheServerSide">
<?dbhtml filename="DecidingWhatToChangeOnTheServerSide.html"?>
<title>What should I change on the server side?</title>
- <para> The list of zones to be reRendered can be specified as EL
- expression. But there is a question that must be specified more exactly. </para>
+ <para> The list of zones to be reRendered can be specified as EL expression. But
+ there is a question that must be specified more exactly. </para>
<para> The list of Ids is formed during beforePhase of RENDER_RESPONSE. Therefore,
in this case one can point reRender to the Set type Bean's property
and fill the Set during a tracking request. </para>
@@ -1116,10 +1117,11 @@
</emphasis> attribute to bind the rowKeys to be reRendered there. After you
need to point reRender on the specific rows. </para-->
<para><emphasis>
- <property>"ajaxKeys"</property>
- </emphasis> attribute defines strings that are updated after an Ajax request. It provides
- possibility to update several child components separately without updating the whole page.</para>
-
+ <property>"ajaxKeys"</property>
+ </emphasis> attribute defines strings that are updated after an Ajax
+ request. It provides possibility to update several child components
+ separately without updating the whole page.</para>
+
<programlisting role="XML"><![CDATA[...
<a4j:poll intervall="1000" action="#{repeater.action}" reRender="text">
<table>
@@ -1139,66 +1141,126 @@
</section>
<section id="RowSelectionInScrollableDataTable">
<?dbhtml filename="RowSelectionInScrollableDataTable.html"?>
- <title>How to get row selection in scrollableDataTable using one and multi-selection rows mode?</title>
- The <para><emphasis>
- <property>"selection"</property>
- </emphasis> attribute is a reference to object to the instace of <code>org.richfaces.model.selection.Selection</code> interface, containing current selection.</para>
- <para>In order to get the row data in one and multi-selection rows mode you should use
- the <emphasis><property>"selection"</property></emphasis> attribute and then work up the selection in particular way.</para>
-<programlisting role="XML"><![CDATA[...
-<rich:scrollableDataTable frozenColCount="1" height="400px"
- width="700px" id="carList" rows="40" columnClasses="col"
- value="#{dataTableScrollerBean.allCars}" var="category" sortMode="single"
- selection="#{dataTableScrollerBean.selection}">
-
- <rich:column id="make">
- <f:facet name="header">
- <h:outputText styleClass="headerText" value="Make" />
- </f:facet>
- <h:outputText value="#{category.make}" />
- </rich:column>
- <rich:column id="model">
- <f:facet name="header">
- <h:outputText styleClass="headerText" value="Model" />
- </f:facet>
- <h:outputText value="#{category.model}" />
- </rich:column>
- <rich:column id="price">
- <f:facet name="header">
- <h:outputText styleClass="headerText" value="Price" />
- </f:facet>
- <h:outputText value="#{category.price}" />
- </rich:column>
-
-</rich:scrollableDataTable>
-...
-]]></programlisting>
- <para>In order to get data from <property>selection</property> you can create a managed bean like this one.</para>
+ <title>How to get row selection in scrollableDataTable using one and multi-selection
+ rows mode?</title>
+ <para>In order to get row selection in scrollableDataTable using <property>one and
+ multi-selection rows mode</property> you should use the <emphasis>
+ <property>"selection"</property>
+ </emphasis> attribute. </para>
+ <para>In the following example when user submits the form current collection of
+ objects selected by user is placed in the object's property. Then on
+ complete action the <emphasis role="bold">
+ <property><rich:modalPanel></property>
+ </emphasis> with selected data will be shown.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
<programlisting role="XML"><![CDATA[...
+<h:form>
+ <rich:spacer height="30" />
+ <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="200px"
+ width="300px" id="carList" rows="40" columnClasses="col"
+ value="#{dataTableScrollerBean.allCars}" var="category" sortMode="single"
+ selection="#{dataTableScrollerBean.selection}">
+ <rich:column id="make">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Make" />
+ </f:facet>
+ <h:outputText value="#{category.make}" />
+ </rich:column>
+ <rich:column id="model">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Model" />
+ </f:facet>
+ <h:outputText value="#{category.model}" />
+ </rich:column>
+ <rich:column id="price">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Price" />
+ </f:facet>
+ <h:outputText value="#{category.price}" />
+ </rich:column>
+ </rich:scrollableDataTable>
+ <rich:spacer height="20px"/>
+ <a4j:commandButton value="Show Current Selection" reRender="table"
+ action="#{dataTableScrollerBean.takeSelection}"
+ oncomplete="javascript:Richfaces.showModalPanel('panel');"/>
+</h:form>
+<rich:modalPanel id="panel" autosized="true">
+ <f:facet name="header">
+ <h:outputText value="Selected Rows"/>
+ </f:facet>
+ <f:facet name="controls">
+ <span style="cursor:pointer" onclick="javascript:Richfaces.hideModalPanel('panel')">X</span>
+ </f:facet>
+ <rich:dataTable value="#{dataTableScrollerBean.selectedCars}" var="sel" id="table">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Make" />
+ </f:facet>
+ <h:outputText value="#{sel.make}" />
+ </rich:column>
+ <rich:column id="model">
+ <f:facet name="header">
+ <h:outputText value="Model" />
+ </f:facet>
+ <h:outputText value="#{sel.model}" />
+ </rich:column>
+ <rich:column id="price">
+ <f:facet name="header">
+ <h:outputText value="Price" />
+ </f:facet>
+ <h:outputText value="#{sel.price}" />
+ </rich:column>
+ </rich:dataTable>
+</rich:modalPanel>
+...]]></programlisting>
+ <para>In order to build this application, you can create a managed bean like this
+ one. Function <emphasis>
+ <property>takeSelection()</property>
+ </emphasis> fills the array <property>selectedCars</property> with the data,
+ got from the <property>selection</property>. Function <emphasis>
+ <property>getSelectedCars()</property>
+ </emphasis> returns the array <property>selectedCars</property>, which is
+ used for filling <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> with selected row/rows data.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
public class DataTableScrollerBean {
- private SimpleSelection selection = new SimpleSelection();
- private ArrayList<DemoInventoryItem> selectedCars = new ArrayList<DemoInventoryItem>();
-
- ...
-
- public SimpleSelection getSelection() {
- return selection;
- }
-
- public String takeSelection() {
- getSelectedCars().clear();
- Iterator<SimpleRowKey> iterator = getSelection().getKeys();
- while (iterator.hasNext()){
- SimpleRowKey key = iterator.next();
- getSelectedCars().add(getAllCars().get(key.intValue()));
- }
- return null;
- }
-
- public ArrayList<DemoInventoryItem> getSelectedCars() {
- return selectedCars;
- }
-...
-]]></programlisting>
+ private SimpleSelection selection = new SimpleSelection();
+ private ArrayList<DemoInventoryItem> selectedCars = new ArrayList<DemoInventoryItem>();
+ ...
+ public SimpleSelection getSelection() {
+ return selection;
+ }
+ public void setSelection(SimpleSelection selection) {
+ System.out.println("Setting Started");
+ this.selection = selection;
+ System.out.println("Setting Complete");
+ }
+ public String takeSelection() {
+ getSelectedCars().clear();
+ Iterator<SimpleRowKey> iterator = getSelection().getKeys();
+ while (iterator.hasNext()){
+ SimpleRowKey key = iterator.next();
+ getSelectedCars().add(getAllCars().get(key.intValue()));
+ }
+ return null;
+ }
+ public ArrayList<DemoInventoryItem> getSelectedCars() {
+ return selectedCars;
+ }
+ public void setSelectedCars(ArrayList<DemoInventoryItem> selectedCars) {
+ this.selectedCars = selectedCars;
+ }
+}
+...]]></programlisting>
+ <para>Some additional information about usage of <property>one and multi-selection
+ rows mode</property> can be found <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=122543"
+ >here</ulink>.</para>
</section>
</chapter>
17 years, 1 month