JBoss Rich Faces SVN: r937 - trunk/sandbox/scrollable-grid.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-29 13:28:38 -0400 (Tue, 29 May 2007)
New Revision: 937
Modified:
trunk/sandbox/scrollable-grid/generatescript.xml
Log:
Modified: trunk/sandbox/scrollable-grid/generatescript.xml
===================================================================
--- trunk/sandbox/scrollable-grid/generatescript.xml 2007-05-29 17:28:30 UTC (rev 936)
+++ trunk/sandbox/scrollable-grid/generatescript.xml 2007-05-29 17:28:38 UTC (rev 937)
@@ -37,6 +37,7 @@
<file name="/ClientUI/layouts/GridLayoutManager.js"/>
<file name="/ClientUI/controls/grid/GridHeader2.js"/>
<file name="/ClientUI/common/box/SplashBox.js"/>
+ <file name="/ClientUI/controls/grid/DataCash.js"/>
<file name="/ClientUI/controls/grid/GridBody2.js"/>
<file name="/ClientUI/controls/grid/GridFooter2.js"/>
<file name="/ClientUI/controls/grid/Grid2.js"/>
17 years, 7 months
JBoss Rich Faces SVN: r936 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-29 13:28:30 -0400 (Tue, 29 May 2007)
New Revision: 936
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/DataCash.js
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/DataCash.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/DataCash.js 2007-05-29 17:28:22 UTC (rev 935)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/DataCash.js 2007-05-29 17:28:30 UTC (rev 936)
@@ -20,10 +20,18 @@
Object.extend(ClientUI.controls.grid.DataCash.prototype, {
initialize: function(cashSize) {
- var count = cashSize/PKG_SIZE + 1;
+ var count = cashSize/this.PKG_SIZE + 1;
this.cash = new Array(count);
for(var i=0; i<count; i++) {
- this.cash[i] = new Array(PKG_SIZE);
+ this.cash[i] = new Array(this.PKG_SIZE);
}
+ },
+ getRow: function(index) {
+ var i = parseInt(index/this.PKG_SIZE), j = index%this.PKG_SIZE;
+ return this.cash[i][j];
+ },
+ setRow: function(index, row) {
+ var i = parseInt(index/this.PKG_SIZE), j = index%this.PKG_SIZE;
+ this.cash[i][j] = row;
}
});
\ No newline at end of file
17 years, 7 months
JBoss Rich Faces SVN: r935 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-29 13:28:22 -0400 (Tue, 29 May 2007)
New Revision: 935
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody2.js
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody2.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody2.js 2007-05-29 17:28:13 UTC (rev 934)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody2.js 2007-05-29 17:28:22 UTC (rev 935)
@@ -7,6 +7,7 @@
ClientUILib.requireClass("ClientUI.common.box.Box");
ClientUILib.requireClass("ClientUI.common.box.SplashBox");
+ClientUILib.requireClass("ClientUI.controls.grid.DataCash");
/*
* GridHeader.js - Grid control header pane
@@ -128,7 +129,6 @@
this.frozenContentBox = new ClientUI.common.box.Box(frozen);
this.frozenContentBox.makeAbsolute();
-
this.helpObject1 = new ClientUI.common.box.Box($(document.createElement("img")), this.contentBox.getElement());
this.helpObject1.setWidth(10);
this.helpObject1.setHeight(10);
@@ -136,9 +136,8 @@
this.helpObject2 = new ClientUI.common.box.Box($(document.createElement("img")), this.frozenContentBox.getElement());
this.helpObject2.setWidth(10);
this.helpObject2.setHeight(10);
- this.helpObject2.makeAbsolute();
+ this.helpObject2.makeAbsolute();
-
// create row template
var ch = this.frozenContentBox.getElement().firstChild;
while(ch) {
@@ -160,6 +159,16 @@
}
this.parseTemplate(this.templFrozen.getElement(), this.templNormal.getElement());
+
+ // init cash with initial data
+ var cash = this.getCash();
+ var frows = this.templFrozen.getElement().rows;
+ var nrows = this.templNormal.getElement().rows;
+ var count = this.rowsCount;
+ for(var i=0; i<count; i++) {
+ cash.setRow(i, {f: frows[i].innerHTML, n: nrows[i].innerHTML});
+ }
+
this.controlCreated = true;
},
parseTemplate: function(templFrozen, templNormal) {
@@ -180,11 +189,12 @@
this.countToLoad = 0;
this.startRow = 0;
this.startIndex = 0;
- this.currRange = $R(0,this.rowsCount);
+ this.currRange = $R(0, this.rowsCount);
return true;
},
setScrollPos: function(pos) {
+ ClientUILib.log(ClientUILogger.ERROR, "setScrollPos: " + pos);
this.contentBox.getElement().scrollTop = pos;
this.frozenContentBox.getElement().scrollTop = pos;
if(ClientUILib.isIE && !ClientUILib.isIE7) {
@@ -265,9 +275,21 @@
// check direction and predict some next rows
var from = Math.max(first - (forwardDir ? 1 : (this.rowsCount - this.dataVisible - 1)), 0);
- var to = Math.min(first + (forwardDir ? this.rowsCount-1 : this.dataVisible + 1), this.grid.dataModel.getCount() - 1);
+ var to = Math.min(first + (forwardDir ? this.rowsCount-1 : this.dataVisible + 1), this.grid.dataModel.getCount());
+
+ if(from == 0) {
+ to = this.rowsCount;
+ }
+ else if(to == this.grid.dataModel.getCount()) {
+ from = to - this.rowsCount;
+ }
+
var range = $R(from, to);
-
+
+ if(this.currRange.start == from && this.currRange.end == to) {
+ return;
+ }
+
if(from >= to) {
ClientUILib.log(ClientUILogger.WARNING, "!!! GridBody: adjustDataPosition. Pos: " + pos + ", From:" + from + ", To:" + to);
return;
@@ -371,6 +393,15 @@
startIndex = this.currRange.end;
}
}
+ else if(range.start == this.currRange.start) {
+ switchType = 3;
+ countToLoad = range.end - this.currRange.end;
+ if(countToLoad > 0) {
+ startIndex = this.currRange.end;
+ var restCount = this.rowsCount - countToLoad;
+ startRowIndx = frozenTbl.rows[restCount].index;
+ }
+ }
else {
switchType = 2;
countToLoad = this.currRange.start - range.start;
@@ -392,27 +423,36 @@
if(countToLoad > 0 && process) {
this.updateStarted = true;
ClientUILib.log(ClientUILogger.WARNING, "Start loading...");
+ ClientUILib.log(ClientUILogger.WARNING, "start index: " + startIndex + ", and startRow: " + startRowIndx + ", and count: " + countToLoad);
this.currRange = range;
this.currentPos = task.pos;
this.taskDefineTime = (new Date()).getTime();
this.showSplash();
-
- // Make timer to handle quick clicks on scrollbar arrows
- setTimeout(function() {
-
- // 4. start data loading
- //this.container.hide();
- this.updateInterval = screen.updateInterval;
- screen.updateInterval = 500;
-
- this.grid.dataModel.loadRows({
+
+ var options = {
index: startIndex,
count: countToLoad,
startRow: startRowIndx,
- switchType: switchType});
- }.bind(this), 10);
+ switchType: switchType
+ };
+ options = this.processCashedValues(options);
+ if(options.count > 0) {
+ // Make timer to handle quick clicks on scrollbar arrows
+ setTimeout(function() {
+
+ // 4. start data loading
+ this.container.hide();
+ this.updateInterval = screen.updateInterval;
+ screen.updateInterval = 1000;
+
+ this.grid.dataModel.loadRows(options);
+ }.bind(this), 10);
+ }
+ else {
+ this.updateStarted = false;
+ }
}
else {
this.updateStarted = false;
@@ -433,110 +473,143 @@
this.splash.updateLayout();
},
- /**
- * show hiden rows after loading them from datasource
- * @param {Object} options
- */
- invalidate: function(options) {
-
- ClientUILib.log(ClientUILogger.WARNING, "Stop loading.");
+ rearrangeRows: function(options, updateCash, showContainer) {
var frozenTbl = this.templFrozen.getElement();
var normalTbl = this.templNormal.getElement();
-
- screen.updateInterval = this.updateInterval;
- //this.container.show();
-
- setTimeout(function (){
- if(options.switchType === 0) {
- var visibleRowPos = this.defaultRowHeight * options.index;
- this.templFrozen.moveToY(visibleRowPos);
- this.templNormal.moveToY(visibleRowPos);
+ var cash = this.getCash();
+
+ if(options.switchType === 0) {
+ var visibleRowPos = this.defaultRowHeight * options.index;
+ var test = this.contentBox.getElement().scrollTop;
+ if(showContainer) this._showContainer();
+ this.templFrozen.moveToY(visibleRowPos);
+ this.templNormal.moveToY(visibleRowPos);
+
+ if(updateCash) {
+ var frows = frozenTbl.rows;
+ var nrows = normalTbl.rows;
+ var count = frows.length;
+ var index = options.index;
+ for(var i=0; i<count; i++) {
+ cash.setRow(index+i, {f: frows[i].innerHTML, n: nrows[i].innerHTML});
+ }
}
- else if(options.switchType === 1 || options.switchType === 2) {
- // store visible row pos to restore after rows reerrange
- var count = frozenTbl.rows.length;
- var frows = new Array(count), nrows = new Array(count);
- var j = 0;
-
- if(options.switchType === 1) {
- for(i=options.count; i<this.rowsCount; i++) {
- frows[j] = frozenTbl.rows[i];
- nrows[j] = normalTbl.rows[i];
- j++;
+ }
+ else if(options.switchType === 1 || options.switchType === 2) {
+ // store visible row pos to restore after rows reerrange
+ var count = frozenTbl.rows.length;
+ var frows = new Array(count), nrows = new Array(count);
+ var j = 0, i;
+ var index = options.index;
+
+ if(options.switchType === 1) {
+ for(i=options.count; i<this.rowsCount; i++) {
+ frows[j] = frozenTbl.rows[i];
+ nrows[j] = normalTbl.rows[i];
+ j++;
+ }
+ for(i=0; i<options.count; i++) {
+ frows[j] = frozenTbl.rows[i];
+ nrows[j] = normalTbl.rows[i];
+ if(updateCash) {
+ cash.setRow(index+i, {f: frows[j].innerHTML, n: nrows[j].innerHTML});
}
- for(i=0; i<options.count; i++) {
- frows[j] = frozenTbl.rows[i];
- nrows[j] = normalTbl.rows[i];
- j++;
- }
+ j++;
}
- else {
- for(i=this.rowsCount - options.count; i<this.rowsCount; i++) {
- frows[j] = frozenTbl.rows[i];
- nrows[j] = normalTbl.rows[i];
- j++;
+ }
+ else {
+ for(i=this.rowsCount - options.count; i<this.rowsCount; i++) {
+ frows[j] = frozenTbl.rows[i];
+ nrows[j] = normalTbl.rows[i];
+ if(updateCash) {
+ cash.setRow(index+j, {f: frows[j].innerHTML, n: nrows[j].innerHTML});
}
- for(i=0; i<this.rowsCount - options.count; i++) {
- frows[j] = frozenTbl.rows[i];
- nrows[j] = normalTbl.rows[i];
- j++;
- }
+ j++;
}
-
-
- // Mozilla is faster when doing the DOM manipulations on
- // an orphaned element. MSIE is not
- var removeChilds = navigator.product == "Gecko";
- var fbody = frozenTbl.tBodies[0];
- var nbody = normalTbl.tBodies[0];
- var fnextSibling = fbody.nextSibling;
- var nnextSibling = nbody.nextSibling;
-
- if (removeChilds) { // remove all rows
- fp = fbody.parentNode;
- fp.removeChild(fbody);
- np = nbody.parentNode;
- np.removeChild(nbody);
+ for(i=0; i<this.rowsCount - options.count; i++) {
+ frows[j] = frozenTbl.rows[i];
+ nrows[j] = normalTbl.rows[i];
+ j++;
}
+ }
- if(options.switchType === 2) {
- var visibleRowPos = options.index * this.defaultRowHeight;
- this.templFrozen.moveToY(visibleRowPos);
- this.templNormal.moveToY(visibleRowPos);
- }
- // insert in the new order
- for (i = 0; i < count; i++) {
- fbody.appendChild(frows[i]);
- nbody.appendChild(nrows[i]);
- }
+ // Mozilla is faster when doing the DOM manipulations on
+ // an orphaned element. MSIE is not
+ var removeChilds = navigator.product == "Gecko";
+ var fbody = frozenTbl.tBodies[0];
+ var nbody = normalTbl.tBodies[0];
+ var fnextSibling = fbody.nextSibling;
+ var nnextSibling = nbody.nextSibling;
- if(removeChilds) {
- fp.insertBefore(fbody, fnextSibling);
- np.insertBefore(nbody, nnextSibling);
+ if (removeChilds) { // remove all rows
+ fp = fbody.parentNode;
+ fp.removeChild(fbody);
+ np = nbody.parentNode;
+ np.removeChild(nbody);
+ }
+
+ // insert in the new order
+ for (i = 0; i < count; i++) {
+ fbody.appendChild(frows[i]);
+ nbody.appendChild(nrows[i]);
+ }
+
+ if(removeChilds) {
+ fp.insertBefore(fbody, fnextSibling);
+ np.insertBefore(nbody, nnextSibling);
+ }
+
+ var visibleRowPos = (options.switchType == 1) ? this.currRange.start * this.defaultRowHeight : options.index * this.defaultRowHeight;
+ if(showContainer) this._showContainer();
+ this.templFrozen.moveToY(visibleRowPos);
+ this.templNormal.moveToY(visibleRowPos);
+ }
+ else {
+ if(updateCash) {
+ var frows = frozenTbl.rows;
+ var nrows = normalTbl.rows;
+ var count = frows.length;
+ var index = options.index;
+ for(var i=0; i<count; i++) {
+ cash.setRow(index+i, {f: frows[i].innerHTML, n: nrows[i].innerHTML});
}
-
- if(options.switchType === 1) {
- var visibleRowPos = this.currRange.start * this.defaultRowHeight;
- this.templFrozen.moveToY(visibleRowPos);
- this.templNormal.moveToY(visibleRowPos);
- }
}
-
+ var visibleRowPos = this.currRange.start * this.defaultRowHeight;
+ if(showContainer) this._showContainer();
+ this.templFrozen.moveToY(visibleRowPos);
+ this.templNormal.moveToY(visibleRowPos);
+ }
+ },
+ _showContainer: function() {
+ this.container.show();
+ this.setScrollPos(this.currentPos);
+ },
+ /**
+ * show hiden rows after loading them from datasource
+ * @param {Object} options
+ */
+ invalidate: function(options) {
+
+ ClientUILib.log(ClientUILogger.WARNING, "Stop loading.");
+ screen.updateInterval = this.updateInterval;
+
+ setTimeout(function () {
+ this.rearrangeRows(options, true, true);
this.splash.hide();
this.updateStarted = false;
+
}.bind(this), 10);
-
- if(this.processedPos != this.currentPos) {
+ /*if(this.processedPos != this.currentPos) {
this.currentPos = this.processedPos;
setTimeout(function (){
this.pendedUpdate();
}.bind(this), this.grid.dataModel.getRequestDelay());
- }
+ }*/
},
- pendedUpdate: function() {
+ /*pendedUpdate: function() {
if(this.processedPos != this.currentPos) {
this.currentPos = this.processedPos;
setTimeout(function (){
@@ -546,5 +619,62 @@
else {
this.adjustDataPosition(this.processedPos);
}
+ },*/
+ getCash: function() {
+ if(!this.cash) {
+ this.cash = new ClientUI.controls.grid.DataCash(this.grid.dataModel.getCount());
+ }
+ return this.cash;
+ },
+ processCashedValues: function(options) {
+ return options;
+
+ var cash = this.getCash();
+ var opt = {};
+ var frows = this.templFrozen.getElement().rows;
+ var nrows = this.templNormal.getElement().rows;
+
+ var i = 0;
+ var count = opt.count;
+ var index = opt.index;
+ var startRow = opt.startRow;
+ var rowC, row, rowU;
+ while(i<count && !(rowC = cash.getRow(index + i))) i++;
+ if(i<count) {
+ if(i > 0) {
+ options.count = i;
+ }
+ opt.count = count - i;
+ opt.index = index + i;
+ startRow += i;
+ if(startRow >= this.rowsCount) startRow -= this.rowsCount;
+ opt.startRow = startRow;
+
+ do {
+ row = frows[startRow];
+ rowU = row.cloneNode(true);
+ rowU.innerHTML = rowC.f;
+ row.parentNode.replaceChild(rowU, row);
+
+ row = nrows[startRow];
+ rowU = row.cloneNode(true);
+ rowU.innerHTML = rowC.n;
+ row.parentNode.replaceChild(rowU, row);
+
+ i++;
+ startRow++;
+ if(startRow >= this.rowsCount) startRow = 0;
+ rowC = cash.getRow(index + i);
+ } while(i<count && rowC);
+
+ if(i<=count) {
+ options.count = count - i;
+ options.index = index + i;
+ opt.count = i;
+ }
+ this.rearrangeRows(opt);
+ }
+
+ return options;
}
});
17 years, 7 months
JBoss Rich Faces SVN: r934 - trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-29 13:28:13 -0400 (Tue, 29 May 2007)
New Revision: 934
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-29 17:27:14 UTC (rev 933)
+++ trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-29 17:28:13 UTC (rev 934)
@@ -11,7 +11,7 @@
baseclass="org.richfaces.renderkit.html.ScrollableGridBaseRenderer"
component="org.richfaces.component.UIScrollableGrid"
>
-
+ <jsp:directive.page import="javax.faces.component.UIComponent"/>
<h:styles>
/org/richfaces/renderkit/html/css/grid.xcss
</h:styles>
@@ -27,7 +27,6 @@
<f:call name="setUpColumnsWidth"/>
- <div id="loadLabel" style="display:none; background-color: #A0D1FF; border: 1px solid #0027C4; width: 200px; height: 50px; text-align: center; vertical-align: middle;"><font size='4' color='white'>Loading...</font></div>
<div id="#{clientId}_GridContainer" style="width: #{component.attributes['width']};height: #{component.attributes['height']};" class="ClientUI_Grid" >
<div id="#{clientId}_GridHeaderTemplate" class="ClientUI_InlineBox" style="width: #{component.attributes['width']};">
@@ -191,6 +190,16 @@
// ]]>
</script>
+
+ <jsp:scriptlet>
+ if(component.getFacets().containsKey("splash")){
+ UIComponent splash = component.getFacet("splash");
+ String splash_id = splash.getClientId(context);
+ variables.setVariable("splash_id",splash_id);
+ renderChild(context, splash);
+ }
+ </jsp:scriptlet>
+
<script id="#{clientId}_grid_create_scripts" type="text/javascript">
//<![CDATA[
@@ -230,8 +239,10 @@
indexColumnWidth: 40
}
);
+
+ var splash_id = '#{splash_id}';
- var progress = new ClientUI.common.box.SplashBox("loadLabel", null, 300, true);
+ var progress = new ClientUI.common.box.SplashBox(splash_id, null, 300, true);
grid.setProgressCtrl(progress);
Event.observe(grid.eventOnSort, "on sort", onSorted);
17 years, 7 months
JBoss Rich Faces SVN: r933 - trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-29 13:27:14 -0400 (Tue, 29 May 2007)
New Revision: 933
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
Log:
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-05-29 13:41:21 UTC (rev 932)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-05-29 17:27:14 UTC (rev 933)
@@ -45,8 +45,14 @@
width="800px"
height="500px"
visualModel="#{selectionBean.visualModel}">
-
- <sg:column width="200px">
+
+ <f:facet name="splash">
+ <h:panelGroup id="splash">
+ <div style="display:none; background-color: #A0D1FF; border: 1px solid #0027C4; width: 200px; height: 50px; text-align: center; vertical-align: middle;"><font size='4' color='white'>Loading...</font></div>
+ </h:panelGroup>
+ </f:facet>
+
+ <sg:column width="200px">
<f:facet name="header">
<h:outputText value="Index"></h:outputText>
</f:facet>
17 years, 7 months
JBoss Rich Faces SVN: r932 - in trunk/richfaces/dropdown-menu/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-05-29 09:41:21 -0400 (Tue, 29 May 2007)
New Revision: 932
Modified:
trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
Exadel replaced with RichFaces
Modified: trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-05-29 12:46:15 UTC (rev 931)
+++ trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-05-29 13:41:21 UTC (rev 932)
@@ -45,8 +45,8 @@
import org.richfaces.renderkit.ScriptOptions;
-public class DropDownMenuRendererBase extends HeaderResourcesRendererBase {
-
+public class DropDownMenuRendererBase extends HeaderResourcesRendererBase {
+
protected Class getComponentClass() {
return UIDropDownMenu.class;
}
@@ -58,10 +58,10 @@
public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
List flatListOfNodes = new LinkedList();
String width = (String)component.getAttributes().get("popupWidth");
-
+
flatten(component.getChildren(), flatListOfNodes);
processLayer(context, component, width);
-
+
for (Iterator iter = flatListOfNodes.iterator(); iter.hasNext();) {
UIMenuGroup node = (UIMenuGroup) iter.next();
if (node.isRendered() && !node.isDisabled()) processLayer(context, node, width);
@@ -82,19 +82,19 @@
writer.startElement("div", layer);
writer.writeAttribute("class", "dr-menu-list-strut rich-menu-list-strut", null);
-
+
writer.startElement("img", layer);
writer.writeAttribute("width", "1", null);
writer.writeAttribute("height", "1", null);
writer.writeAttribute("alt", "", null);
writer.writeAttribute("border", "0", null);
writer.writeAttribute("style", width!=null && width.length() > 0 ? "width: " + HtmlUtil.qualifySize(width) : "", null);
- writer.writeAttribute("src",
- getResource("/org/richfaces/renderkit/html/images/spacer.gif").getUri(context, null),
+ writer.writeAttribute("src",
+ getResource("/org/richfaces/renderkit/html/images/spacer.gif").getUri(context, null),
null);
writer.endElement("img");
writer.endElement("div");
-
+
writer.endElement("div");
writer.endElement("div");
@@ -103,19 +103,19 @@
writer.writeAttribute("class", "underneath_iframe", null);
writer.writeAttribute("style", "position:absolute", null);
writer.endElement("iframe");
-
+
writer.startElement("script", layer);
writer.writeAttribute("id", clientId+"_menu_script", null);
writer.writeAttribute("type", "text/javascript", null);
encodeScript(context, layer);
writer.endElement("script");
-
+
AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
Set renderedAreas = ajaxContext.getAjaxRenderedAreas();
renderedAreas.add(clientId + "_menu_iframe");
renderedAreas.add(clientId + "_menu_script");
}
-
+
public void encodeItems(FacesContext context, UIComponent component) throws IOException {
List kids = component.getChildren();
Iterator it = kids.iterator();
@@ -142,7 +142,7 @@
public void encodeScript(FacesContext context, UIComponent component) throws IOException {
StringBuffer buffer = new StringBuffer();
- JSFunction function = new JSFunction("new Exadel.Menu.Layer");
+ JSFunction function = new JSFunction("new RichFaces.Menu.Layer");
function.addParameter(component.getClientId(context)+"_menu");
function.addParameter(component.getAttributes().get("showDelay"));
if (component instanceof UIDropDownMenu) {
@@ -151,8 +151,8 @@
else{
function.addParameter(""+300);
}
- function.appendScript(buffer);
- if (component instanceof UIMenuGroup) {
+ function.appendScript(buffer);
+ if (component instanceof UIMenuGroup) {
buffer.append(".");
function = new JSFunction("asSubMenu");
function.addParameter(component.getParent().getClientId(context)+"_menu");
@@ -168,7 +168,7 @@
Optionssub.addOption("direction", component.getAttributes().get("direction"));
function.addParameter(Optionssub);
function.appendScript(buffer);
-
+
} else {
buffer.append(".");
function = new JSFunction("asDropDown");
@@ -180,12 +180,12 @@
function.addParameter(evt);
function.addParameter("onmouseout");
ScriptOptions Options = new ScriptOptions(component);
-
+
Options.addOption("direction", component.getAttributes().get("direction"));
Options.addOption("jointPoint", component.getAttributes().get("jointPoint"));
- Options.addOption("verticalOffset", component.getAttributes().get("verticalOffset"));
-
-
+ Options.addOption("verticalOffset", component.getAttributes().get("verticalOffset"));
+
+
Options.addOption("horizontalOffset", component.getAttributes().get("horizontalOffset"));
Options.addOption("oncollapse", component.getAttributes().get("oncollapse"));
Options.addOption("onexpand", component.getAttributes().get("onexpand"));
@@ -193,9 +193,9 @@
Options.addOption("ongroupactivate", component.getAttributes().get("ongroupactivate"));
function.addParameter(Options);
function.appendScript(buffer);
-
+
}
-
+
List children = component.getChildren();
for(Iterator it = children.iterator();it.hasNext();) {
UIComponent kid = (UIComponent)it.next();
@@ -206,13 +206,13 @@
UIMenuItem MenuItem=(UIMenuItem)kid;
itemId = kid.getClientId(context);
if (MenuItem.isDisabled()){
- flcloseonclick=0;
+ flcloseonclick=0;
}
} else if (kid instanceof UIMenuGroup) {
UIMenuGroup menuGroup=(UIMenuGroup)kid;
itemId = "ref" + kid.getClientId(context);
flcloseonclick=0;
- if (menuGroup.isDisabled()) flagGroup = 2; else flagGroup = 1;
+ if (menuGroup.isDisabled()) flagGroup = 2; else flagGroup = 1;
}
if(itemId != null){
function = new JSFunction("addItem");
@@ -230,14 +230,14 @@
function.appendScript(buffer);
}
}
-
+
ResponseWriter out = context.getResponseWriter();
String script =buffer.append(";").toString();
- out.write(script);
-
-
-
+ out.write(script);
+
+
+
}
-
-
+
+
}
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-05-29 12:46:15 UTC (rev 931)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-05-29 13:41:21 UTC (rev 932)
@@ -5,15 +5,15 @@
var LOG = {a4j_debug:function(){}};
}
-if(!Exadel) var Exadel = {};
-if(!Exadel.Menu) Exadel.Menu = {};
+if(!RichFaces) var RichFaces = {};
+if(!RichFaces.Menu) RichFaces.Menu = {};
/**
* Fixes IE bug with incorrect layer width when set to auto
- * @param layer
+ * @param layer
*/
-Exadel.Menu.fitLayerToContent = function(layer) {
- if (!Exadel.Menu.Layers.IE)
+RichFaces.Menu.fitLayerToContent = function(layer) {
+ if (!RichFaces.Menu.Layers.IE)
return;
var table = layer.childNodes[0];
@@ -27,7 +27,7 @@
} // if
}
-Exadel.Menu.removePx = function(e) {
+RichFaces.Menu.removePx = function(e) {
if ((e+"").indexOf("px")!=-1)
return (e+"").substring(0,e.length-2);
else
@@ -35,7 +35,7 @@
}
-Exadel.Menu.Layers = {
+RichFaces.Menu.Layers = {
listl: new Array(),
father: {},
lwidthDetected:false,
@@ -107,7 +107,7 @@
}
this.detectWidth();
var menu = $(menuName);
- Exadel.Menu.fitLayerToContent(menu);
+ RichFaces.Menu.fitLayerToContent(menu);
var visible = this.isVisible(menuName);
this.setVisibility(menuName, visibleFlag);
this.ieSelectWorkAround(menuName, visibleFlag);
@@ -120,7 +120,7 @@
var menuLayer = this.layers[menu.id];
if (menuLayer && menuLayer.eventOnOpen) menuLayer.eventOnOpen();
if (menuLayer && menuLayer.eventOnExpand) menuLayer.eventOnExpand();
-
+
if (menuLayer.level>0) {
do {
menuLayer = this.layers[(this.father[menuLayer.id])];
@@ -160,11 +160,11 @@
needToResetLayers = true;
}
}
-
+
if (needToResetLayers) {
this.resetLayers();
}
-
+
this.layerPoppedUp = '';
if (this.Konqueror || this.IE5) {
this.seeThroughElements(true);
@@ -178,12 +178,12 @@
newList.push(layer);
}
}
-
+
this.listl = newList;
}
,
- /**
+ /**
* Set visibility
* @param layer the layer to visibility
* @param visible the boolean flag, if true to set visible layer from variable, otherwise - hide this layer
@@ -220,7 +220,7 @@
}
if (this.useTimeouts) {
clearTimeout(this.timeoutFlag);
- this.timeoutFlag = setTimeout('Exadel.Menu.Layers.shutdown()', ratio);
+ this.timeoutFlag = setTimeout('RichFaces.Menu.Layers.shutdown()', ratio);
}
},
@@ -231,12 +231,12 @@
},
showMenuLayer: function (layerId, e, delay){
this.clearPopUpTO();
- this.showTimeOutFlag = setTimeout(new Exadel.Menu.DelayedPopUp(layerId, e, function(){this.layerId = null;}.bind(this)).show, delay);
+ this.showTimeOutFlag = setTimeout(new RichFaces.Menu.DelayedPopUp(layerId, e, function(){this.layerId = null;}.bind(this)).show, delay);
this.layerId = layerId;
},
showDropDownLayer: function (layerId, parentId, e, delay){
this.clearPopUpTO();
- this.showTimeOutFlag = setTimeout(new Exadel.Menu.DelayedDropDown(layerId, parentId, e).show, delay);
+ this.showTimeOutFlag = setTimeout(new RichFaces.Menu.DelayedDropDown(layerId, parentId, e).show, delay);
},
showPopUpLayer: function (layer, e){
this.shutdown();
@@ -249,11 +249,11 @@
/**
* return true if defined document element or document body, otherwise return false
*/
-Exadel.Menu.getWindowElement = function() {
+RichFaces.Menu.getWindowElement = function() {
return (document.documentElement || document.body);
}
-Exadel.Menu.getWindowDimensions = function() {
+RichFaces.Menu.getWindowDimensions = function() {
var x,y;
if (self.innerHeight) // all except Explorer
{
@@ -274,7 +274,7 @@
return {width:x, height:y};
}
-Exadel.Menu.getWindowScrollOffset = function() {
+RichFaces.Menu.getWindowScrollOffset = function() {
var x,y;
if (typeof pageYOffset != "undefined") // all except Explorer
{
@@ -296,11 +296,11 @@
return {top:y, left: x};
}
-Exadel.Menu.getPageDimensions = function() {
+RichFaces.Menu.getPageDimensions = function() {
var x,y;
var test1 = document.body.scrollHeight;
var test2 = document.body.offsetHeight;
- if (test1 > test2) {
+ if (test1 > test2) {
// all but Explorer Mac
x = document.body.scrollWidth;
y = document.body.scrollHeight;
@@ -317,7 +317,7 @@
}
-Exadel.Menu.DelayedContextMenu = function(layer, e) {
+RichFaces.Menu.DelayedContextMenu = function(layer, e) {
if (!e) {
e = window.event;
}
@@ -325,9 +325,9 @@
this.element = Event.element(e);
this.layer = $(layer);
this.show = function() {
- Exadel.Menu.Layers.shutdown();
- var body = Exadel.Menu.getPageDimensions();
- var win = Exadel.Menu.getWindowDimensions();
+ RichFaces.Menu.Layers.shutdown();
+ var body = RichFaces.Menu.getPageDimensions();
+ var win = RichFaces.Menu.getWindowDimensions();
var bodyHeight = body.height;
var bodyWidth = body.width;
var clientX = this.event.clientX;
@@ -339,7 +339,7 @@
var layerLeft = left;
if (clientX + layerdim.width > win.width) {
- layerLeft -= (layerdim.width - Exadel.Menu.Layers.shadowWidth - Exadel.Menu.Layers.CornerRadius);
+ layerLeft -= (layerdim.width - RichFaces.Menu.Layers.shadowWidth - RichFaces.Menu.Layers.CornerRadius);
}
if (layerLeft < 0) {
@@ -365,7 +365,7 @@
}
*/
if (clientY + layerdim.height > win.height) {
- layerTop -= (layerdim.height - Exadel.Menu.Layers.shadowWidth - Exadel.Menu.Layers.CornerRadius);
+ layerTop -= (layerdim.height - RichFaces.Menu.Layers.shadowWidth - RichFaces.Menu.Layers.CornerRadius);
}
if (layerTop < 0) {
@@ -375,8 +375,8 @@
this.layer.style.left = layerLeft + "px";
this.layer.style.top = layerTop + "px";
- Exadel.Menu.Layers.LMPopUp(this.layer.id, false);
- Exadel.Menu.Layers.clearLMTO();
+ RichFaces.Menu.Layers.LMPopUp(this.layer.id, false);
+ RichFaces.Menu.Layers.clearLMTO();
}.bind(this);
}
@@ -384,7 +384,7 @@
/**
* Calculates for DROPDOWN
*/
-Exadel.Menu.DelayedDropDown = function(layer, elementId, e) {
+RichFaces.Menu.DelayedDropDown = function(layer, elementId, e) {
if (!e) {
e = window.event;
}
@@ -415,7 +415,7 @@
}
return list;
}.bind(this);
-
+
this.calcPosition = function(jp, dir) {
var layerLeft;
var layerTop;
@@ -452,16 +452,16 @@
}.bind(this);
this.show = function() {
- Exadel.Menu.Layers.shutdown();
-
- var winOffset = Exadel.Menu.getWindowScrollOffset();
- var win = Exadel.Menu.getWindowDimensions();
- var pageDims = Exadel.Menu.getPageDimensions();
+ RichFaces.Menu.Layers.shutdown();
+ var winOffset = RichFaces.Menu.getWindowScrollOffset();
+ var win = RichFaces.Menu.getWindowDimensions();
+ var pageDims = RichFaces.Menu.getPageDimensions();
+
var windowHeight = win.height;
var windowWidth = win.width;
-
+
// var screenOffset = Position.cumulativeOffset(this.element);
// if (Element.getStyle(this.element, 'position') == 'absolute') {
// screenOffset[0] = 0;
@@ -470,23 +470,23 @@
var screenOffset = Position.positionedOffset(this.element);
var innerDiv = this.element.lastChild;
var dim = Element.getDimensions(this.element);
-
+
var parOffset = Position.cumulativeOffset(this.element);
var divOffset = Position.cumulativeOffset(innerDiv);
var deltaX = divOffset[0] - parOffset[0];
var deltaY = divOffset[1] - parOffset[1];
-
+
// parent element
this.top = screenOffset[1];
this.left = screenOffset[0];
this.bottom = this.top + dim.height;
this.right = this.left + dim.width;
-
+
this.layerdim = Element.getDimensions(this.layer);
- var options = Exadel.Menu.Layers.layers[this.layer.id].options;
-
+ var options = RichFaces.Menu.Layers.layers[this.layer.id].options;
+
var jointPoint = 0;
if (options.jointPoint) {
var sJp = options.jointPoint.toUpperCase();
@@ -495,7 +495,7 @@
jointPoint = sJp.indexOf('BR') != -1?3:jointPoint;
jointPoint = sJp.indexOf('BL') != -1?4:jointPoint;
}
-
+
var direction = 0;
if (options.direction) {
var sDir = options.direction.toUpperCase();
@@ -506,15 +506,15 @@
}
var hOffset = options.horizontalOffset;
var vOffset = options.verticalOffset;
-
+
var listPos = this.listPositions(jointPoint, direction);
var layerPos;
var foundPos = false;
for (var i=0;i<listPos.length;i++) {
layerPos = this.calcPosition(listPos[i].jointPoint, listPos[i].direction)
- if ((layerPos.left + hOffset >= winOffset.left) &&
+ if ((layerPos.left + hOffset >= winOffset.left) &&
(layerPos.left + hOffset + this.layerdim.width - winOffset.left <= windowWidth) &&
- (layerPos.top + vOffset >= winOffset.top) &&
+ (layerPos.top + vOffset >= winOffset.top) &&
(layerPos.top + vOffset + this.layerdim.height - winOffset.top <= windowHeight)) {
foundPos = true;
break;
@@ -527,17 +527,17 @@
this.layer.style.top = layerPos.top + vOffset - deltaY - this.top + "px";
this.layer.style.width = this.layer.clientWidth + "px";
-
- Exadel.Menu.Layers.LMPopUp(this.layer.id, false);
- Exadel.Menu.Layers.clearLMTO();
+
+ RichFaces.Menu.Layers.LMPopUp(this.layer.id, false);
+ RichFaces.Menu.Layers.clearLMTO();
}.bind(this);
}
-Exadel.Menu.DelayedPopUp = function(layer, e) {
+RichFaces.Menu.DelayedPopUp = function(layer, e) {
if (!e) {
e = window.event;
}
-
+
this.event = e;
this.element = Event.findElement(e, 'div');
if (this.element.id.indexOf(":folder") == (this.element.id.length -7) ) {
@@ -546,23 +546,23 @@
this.layer = $(layer);
this.show = function() {
- if (!Exadel.Menu.Layers.isVisible(this.layer) &&
- Exadel.Menu.Layers.isVisible(Exadel.Menu.Layers.father[this.layer.id])) {
+ if (!RichFaces.Menu.Layers.isVisible(this.layer) &&
+ RichFaces.Menu.Layers.isVisible(RichFaces.Menu.Layers.father[this.layer.id])) {
this.reposition();
- Exadel.Menu.Layers.LMPopUp(this.layer, false);
+ RichFaces.Menu.Layers.LMPopUp(this.layer, false);
}
}.bind(this);
}
-Exadel.Menu.DelayedPopUp.prototype.reposition = function() {
- var windowShift = Exadel.Menu.getWindowScrollOffset();
- var body = Exadel.Menu.getWindowDimensions();
+RichFaces.Menu.DelayedPopUp.prototype.reposition = function() {
+ var windowShift = RichFaces.Menu.getWindowScrollOffset();
+ var body = RichFaces.Menu.getWindowDimensions();
var windowHeight = body.height;
var windowWidth = body.width;
var scrolls = {top:0, left:0};
var screenOffset = Position.positionedOffset(this.element);
- var leftPx = Exadel.Menu.removePx(this.element.parentNode.parentNode.style.left);
- var topPx = Exadel.Menu.removePx(this.element.parentNode.parentNode.style.top);
+ var leftPx = RichFaces.Menu.removePx(this.element.parentNode.parentNode.style.left);
+ var topPx = RichFaces.Menu.removePx(this.element.parentNode.parentNode.style.top);
screenOffset[0]+=Number(leftPx);
screenOffset[1]+=Number(topPx);
var cumulativeOffset = Position.cumulativeOffset(this.element);
@@ -574,7 +574,7 @@
var right = left + dim.width;
var layerdim = Element.getDimensions(this.layer);
- var options = Exadel.Menu.Layers.layers[this.layer.id].options;
+ var options = RichFaces.Menu.Layers.layers[this.layer.id].options;
var dir = 0;
if (options.direction) {
dir = options.direction.toUpperCase().indexOf('LEFT')!=-1?1:dir;
@@ -583,19 +583,19 @@
var layerLeft = right;
var layerTop = top;
-
+
if (dir == 0) {
if (layerLeft + layerdim.width + labelOffset[0] - windowShift.left >= windowWidth) {
var invisibleRight = layerLeft + layerdim.width + labelOffset[0] - windowShift.left - windowWidth;
layerLeft = left - layerdim.width;
}
-
+
if (layerLeft + labelOffset[0] < 0) {
if (Math.abs(layerLeft + labelOffset[0]) > invisibleRight) {
layerLeft = right;
}
}
-
+
} else if (dir == 1) {
layerLeft = left - layerdim.width;
}
@@ -613,11 +613,11 @@
if (Math.abs(layerTop) > invisibleBottom) layerTop = top;
}
}
-
+
}
/* if (layerLeft + layerdim.width >= windowWidth) {
- layerLeft = left - layerdim.width + Exadel.Menu.Layers.shadowWidth;
+ layerLeft = left - layerdim.width + RichFaces.Menu.Layers.shadowWidth;
}
if (layerLeft < 0) {
@@ -639,29 +639,29 @@
itemOffset = Position.cumulativeOffset(lastItem);
layertop = top -(itemOffset[1]-layerOffset[1]);
}
- } else layertop = top - Exadel.Menu.Layers.CornerRadius;
-
+ } else layertop = top - RichFaces.Menu.Layers.CornerRadius;
+
if (layertop < 0) {
layertop = 0;
} */
this.layer.style.left = layerLeft + "px";
this.layer.style.top = layerTop + "px";
-
+
this.layer.style.width = this.layer.clientWidth + "px";
-
+
}
/**
- * set to true when a dropdown box inside menu receives focus
+ * set to true when a dropdown box inside menu receives focus
*/
-Exadel.Menu.selectOpen = false;
-Exadel.Menu.MouseIn = false;
+RichFaces.Menu.selectOpen = false;
+RichFaces.Menu.MouseIn = false;
-Exadel.Menu.Layer = Class.create();
-Exadel.Menu.Layer.prototype = {
+RichFaces.Menu.Layer = Class.create();
+RichFaces.Menu.Layer.prototype = {
initialize: function(id,delay, hideDelay){
- Exadel.Menu.Layers.listl.push(id);
+ RichFaces.Menu.Layers.listl.push(id);
this.id = id;
this.layer = $(id);
this.level = 0;
@@ -670,48 +670,48 @@
this.hideDelay=hideDelay;
}
else{
- this.hideDelay=hideDelay;
+ this.hideDelay=hideDelay;
}
- Exadel.Menu.fitLayerToContent(this.layer);
+ RichFaces.Menu.fitLayerToContent(this.layer);
this.items = new Array();
- Exadel.Menu.Layers.layers[id] = this;
+ RichFaces.Menu.Layers.layers[id] = this;
this.bindings = new Array();
- this.mouseover =
+ this.mouseover =
function(e){
- Exadel.Menu.MouseIn=true;
- Exadel.Menu.Layers.clearLMTO();
-
- var menuNode = Exadel.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
+ RichFaces.Menu.MouseIn=true;
+ RichFaces.Menu.Layers.clearLMTO();
+
+ var menuNode = RichFaces.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
menuNode.className='dr-menu-label dr-menu-label-select rich-ddmenu-label rich-ddmenu-label-select';
-
+
Event.stop(e);
}.bindAsEventListener(this);
-
- this.mouseout =
+
+ this.mouseout =
function(e){
- Exadel.Menu.MouseIn = false;
- if (!Exadel.Menu.selectOpen) {
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
+ RichFaces.Menu.MouseIn = false;
+ if (!RichFaces.Menu.selectOpen) {
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
}
- var menuNode = Exadel.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
+ var menuNode = RichFaces.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
menuNode.className='dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect';
-
+
Event.stop(e);
}.bindAsEventListener(this);
- var binding = new Exadel.Menu.Layer.Binding (
+ var binding = new RichFaces.Menu.Layer.Binding (
this.id,
"mouseover",
this.mouseover);
this.bindings.push(binding);
binding.refresh();
- binding = new Exadel.Menu.Layer.Binding (
+ binding = new RichFaces.Menu.Layer.Binding (
this.id,
"mouseout",
this.mouseout);
@@ -724,16 +724,16 @@
var closeSelectb = this.closeSelect.bindAsEventListener(this);
Event.observe(arrayinp[i], "focus", openSelectb);
Event.observe(arrayinp[i], "blur", closeSelectb);
- //var MouseoverInInputb = Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
+ //var MouseoverInInputb = RichFaces.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
var MouseoverInInputb = this.MouseoverInInput.bindAsEventListener(this);
- //var MouseoutInInputb = Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
- var MouseoutInInputb = this.MouseoutInInput.bindAsEventListener(this);
+ //var MouseoutInInputb = RichFaces.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
+ var MouseoutInInputb = this.MouseoutInInput.bindAsEventListener(this);
Event.observe(arrayinp[i], "mouseover", MouseoverInInputb);
Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
-
- //var OnKeyPressb = Exadel.Menu.Layer.OnKeyPress.bindAsEventListener(this);
+
+ //var OnKeyPressb = RichFaces.Menu.Layer.OnKeyPress.bindAsEventListener(this);
var OnKeyPressb = this.OnKeyPress.bindAsEventListener(this);
- Event.observe(arrayinp[i], "keypress", OnKeyPressb);
+ Event.observe(arrayinp[i], "keypress", OnKeyPressb);
}
arrayinp=$A(this.layer.getElementsByTagName("input"));
@@ -742,12 +742,12 @@
var closeSelectb = this.closeSelect.bindAsEventListener(this);
Event.observe(arrayinp[i], "focus", openSelectb);
Event.observe(arrayinp[i], "blur", closeSelectb);
- //var MouseoverInInputb = Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
+ //var MouseoverInInputb = RichFaces.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
var MouseoverInInputb = this.MouseoverInInput.bindAsEventListener(this);
- //var MouseoutInInputb = Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
- var MouseoutInInputb = this.MouseoutInInput.bindAsEventListener(this);
+ //var MouseoutInInputb = RichFaces.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
+ var MouseoutInInputb = this.MouseoutInInput.bindAsEventListener(this);
Event.observe(arrayinp[i], "mouseover", MouseoverInInputb);
- Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
+ Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
var OnKeyPressb = this.OnKeyPress.bindAsEventListener(this);
Event.observe(arrayinp[i], "keypress", OnKeyPressb);
}
@@ -757,13 +757,13 @@
var openSelectb = this.openSelect.bindAsEventListener(this);
var closeSelectb = this.closeSelect.bindAsEventListener(this);
Event.observe(arrayinp[i], "focus", openSelectb);
- Event.observe(arrayinp[i], "blur", closeSelectb);
- //var MouseoverInInputb = Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "blur", closeSelectb);
+ //var MouseoverInInputb = RichFaces.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
var MouseoverInInputb = this.MouseoverInInput.bindAsEventListener(this);
- //var MouseoutInInputb = Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
- var MouseoutInInputb = this.MouseoutInInput.bindAsEventListener(this);
+ //var MouseoutInInputb = RichFaces.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
+ var MouseoutInInputb = this.MouseoutInInput.bindAsEventListener(this);
Event.observe(arrayinp[i], "mouseover", MouseoverInInputb);
- Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
+ Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
}
/* if(window.A4J && A4J.AJAX ){
@@ -774,30 +774,30 @@
- openSelect: function(event){
- Exadel.Menu.selectOpen = true;
+ openSelect: function(event){
+ RichFaces.Menu.selectOpen = true;
var ClickInputb = this.ClickInput.bindAsEventListener(this);
Event.observe(Event.element(event), "click", this.ClickInput);
-
+
},
closeSelect: function(event){
- Exadel.Menu.selectOpen = false;
+ RichFaces.Menu.selectOpen = false;
var ClickInputb = this.ClickInput.bindAsEventListener(this);
Event.stopObserving(Event.element(event), "click", this.ClickInput);
- if (Exadel.Menu.MouseIn == false){
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
+ if (RichFaces.Menu.MouseIn == false){
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
}
},
OnKeyPress: function(event){
-
+
if(event.keyCode==13){
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
- }
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
+ }
},
@@ -814,13 +814,13 @@
return false;
},
-
+
MouseoutInInput: function(event){
var ClickInputb = this.ClickInput.bindAsEventListener(this);
Event.stopObserving(Event.element(event), "click", this.ClickInput);
},
-
+
rebind:function(){
$A(this.bindings)
.each(
@@ -832,17 +832,17 @@
showMe: function(e){
this.closeSiblings(e);
//LOG.a4j_debug('show me ' + this.id +' ' +this.level);
- Exadel.Menu.Layers.showMenuLayer(this.id, e, this.delay);
- Exadel.Menu.Layers.levels[this.level] = this;
+ RichFaces.Menu.Layers.showMenuLayer(this.id, e, this.delay);
+ RichFaces.Menu.Layers.levels[this.level] = this;
// if (this.eventOnOpen) this.eventOnOpen();
},
closeSiblings: function(e){
//LOG.a4j_debug('closeASiblins ' + this.id +' ' +this.level);
- if(Exadel.Menu.Layers.levels[this.level] && Exadel.Menu.Layers.levels[this.level].id != this.id){
- for(var i = this.level; i < Exadel.Menu.Layers.levels.length; i++){
- if(Exadel.Menu.Layers.levels[i]) {
- Exadel.Menu.Layers.levels[i].hideMe();
- //Exadel.Menu.Layers.levels[i] = '';
+ if(RichFaces.Menu.Layers.levels[this.level] && RichFaces.Menu.Layers.levels[this.level].id != this.id){
+ for(var i = this.level; i < RichFaces.Menu.Layers.levels.length; i++){
+ if(RichFaces.Menu.Layers.levels[i]) {
+ RichFaces.Menu.Layers.levels[i].hideMe();
+ //RichFaces.Menu.Layers.levels[i] = '';
}
}
}
@@ -852,10 +852,10 @@
var item = this.items[id];
// if(!item.childMenu){
//LOG.a4j_debug('hiding menus ' + this.id +' ' +this.level);
- for(var i = this.level + (!item.childMenu?1:2); i < Exadel.Menu.Layers.levels.length; i++){
- if(Exadel.Menu.Layers.levels[i]) {
- //LOG.a4j_debug('hide ' +Exadel.Menu.Layers.levels[i]);
- Exadel.Menu.Layers.levels[i].hideMe();
+ for(var i = this.level + (!item.childMenu?1:2); i < RichFaces.Menu.Layers.levels.length; i++){
+ if(RichFaces.Menu.Layers.levels[i]) {
+ //LOG.a4j_debug('hide ' +RichFaces.Menu.Layers.levels[i]);
+ RichFaces.Menu.Layers.levels[i].hideMe();
}
}
// }
@@ -874,7 +874,7 @@
Element.addClassName(this.id,"dr-menu-item-hover");
Element.addClassName(this.id,"rich-menu-group-hover");
if (this.options.selectClass) Element.addClassName(this.id, this.options.selectClass);
-
+
Element.addClassName(this.id+":icon","rich-menu-item-icon-selected");
Element.addClassName(this.id+":anchor","rich-menu-item-label");
} else if (!this.mouseOver) {
@@ -900,7 +900,7 @@
item.eventOnMouseOut = new Function("event",item.options.onmouseout).bindAsEventListener(item);
}
this.items[itemId] = item;
-
+
var onmouseover =
function(e){
this.menu.closeMinors(this.id);
@@ -916,7 +916,7 @@
this.eventOnMouseOver();
}
}.bindAsEventListener(item);
-
+
var onmouseout =
function(e){
if (this.options.flagGroup == 1) {
@@ -934,28 +934,28 @@
var onmouseclick =
function(e){
- var menuLayer = item.menu;
+ var menuLayer = item.menu;
while (menuLayer.level > 0) {
- menuLayer = Exadel.Menu.Layers.layers[(Exadel.Menu.Layers.father[menuLayer.id])];
- }
+ menuLayer = RichFaces.Menu.Layers.layers[(RichFaces.Menu.Layers.father[menuLayer.id])];
+ }
if (menuLayer && menuLayer.eventOnItemSelect) menuLayer.eventOnItemSelect();
- Exadel.Menu.Layers.shutdown();
+ RichFaces.Menu.Layers.shutdown();
}.bindAsEventListener(item);
- var binding = new Exadel.Menu.Layer.Binding (
+ var binding = new RichFaces.Menu.Layer.Binding (
item.id,
"mouseover",
onmouseover);
this.bindings.push(binding);
binding.refresh();
- binding = new Exadel.Menu.Layer.Binding (
+ binding = new RichFaces.Menu.Layer.Binding (
item.id,
"mouseout",
onmouseout);
this.bindings.push(binding);
binding.refresh();
if (flag_close_onclick==1){
- binding = new Exadel.Menu.Layer.Binding (
+ binding = new RichFaces.Menu.Layer.Binding (
item.id,
"click",
onmouseclick);
@@ -966,9 +966,9 @@
return this;
},
hideMe: function(e){
- Exadel.Menu.Layers.clearPopUpTO();
- Exadel.Menu.Layers.levels[this.level] = null;
- Exadel.Menu.Layers.LMPopUpL(this.id, false);
+ RichFaces.Menu.Layers.clearPopUpTO();
+ RichFaces.Menu.Layers.levels[this.level] = null;
+ RichFaces.Menu.Layers.LMPopUpL(this.id, false);
// if (this.eventOnClose) this.eventOnClose();
},
asDropDown: function(topLevel, onEvt, offEvt, options){
@@ -991,7 +991,7 @@
if (!e) {
e = window.event;
}
- Exadel.Menu.Layers.showDropDownLayer(this.id, topLevel, e,this.delay);
+ RichFaces.Menu.Layers.showDropDownLayer(this.id, topLevel, e,this.delay);
}.bindAsEventListener(this);
if(!onEvt){
@@ -1006,23 +1006,23 @@
var dis = this;
var onmouseout =
function(e){
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
- Exadel.Menu.Layers.clearPopUpTO();
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
+ RichFaces.Menu.Layers.clearPopUpTO();
}.bindAsEventListener(this);
// var item = $(topLevel);
- var binding = new Exadel.Menu.Layer.Binding(topLevel,onEvt, onmouseover);
+ var binding = new RichFaces.Menu.Layer.Binding(topLevel,onEvt, onmouseover);
this.bindings.push(binding);
binding.refresh();
- binding = new Exadel.Menu.Layer.Binding (topLevel, offEvt, onmouseout);
+ binding = new RichFaces.Menu.Layer.Binding (topLevel, offEvt, onmouseout);
this.bindings.push(binding);
binding.refresh();
- Exadel.Menu.Layers.horizontals[this.id] = topLevel;
+ RichFaces.Menu.Layers.horizontals[this.id] = topLevel;
// }
return this;
},
-
+
asSubMenu: function(parentv, refLayerName, evtName, options){
this.options = options || {};
if (this.options.onclose != ""){
@@ -1031,34 +1031,34 @@
if (this.options.onopen != ""){
this.eventOnOpen = new Function("event",this.options.onopen).bindAsEventListener(this);
}
-
+
if(!evtName){
evtName = 'onmouseover';
}
evtName = this.eventJsToPrototype(evtName);
- this.level = Exadel.Menu.Layers.layers[parentv].level + 1;
- Exadel.Menu.Layers.father[this.id] = parentv;
+ this.level = RichFaces.Menu.Layers.layers[parentv].level + 1;
+ RichFaces.Menu.Layers.father[this.id] = parentv;
if(!refLayerName){
refLayerName = 'ref' + parentv;
}
var refLayer = $(refLayerName);
- this.refItem = Exadel.Menu.Layers.layers[parentv].items[refLayerName];
+ this.refItem = RichFaces.Menu.Layers.layers[parentv].items[refLayerName];
this.refItem.childMenu = this;
- var binding = new Exadel.Menu.Layer.Binding(refLayerName, evtName, this.showMe.bindAsEventListener(this));
+ var binding = new RichFaces.Menu.Layer.Binding(refLayerName, evtName, this.showMe.bindAsEventListener(this));
this.bindings.push(binding);
binding.refresh();
-
+
// set parents hideDelay
- var menuLayer=this;
+ var menuLayer=this;
while (menuLayer.level > 0) {
- menuLayer = Exadel.Menu.Layers.layers[(Exadel.Menu.Layers.father[menuLayer.id])];
- }
+ menuLayer = RichFaces.Menu.Layers.layers[(RichFaces.Menu.Layers.father[menuLayer.id])];
+ }
if (menuLayer && menuLayer.hideDelay){
this.hideDelay=menuLayer.hideDelay;
- }
+ }
-
+
return this;
},
asContextMenu: function(parent, evt){
@@ -1074,15 +1074,15 @@
var dis = this;
var onmouseout =
function(e){
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
- Exadel.Menu.Layers.clearPopUpTO();
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
+ RichFaces.Menu.Layers.clearPopUpTO();
}.bindAsEventListener(this);
evt = this.eventJsToPrototype(evt);
- var handler = function(e){new Exadel.Menu.DelayedContextMenu(this.id, e).show();}.bindAsEventListener(this);
- var binding = new Exadel.Menu.Layer.Binding (parent, evt, handler);
+ var handler = function(e){new RichFaces.Menu.DelayedContextMenu(this.id, e).show();}.bindAsEventListener(this);
+ var binding = new RichFaces.Menu.Layer.Binding (parent, evt, handler);
this.bindings.push(binding);
binding.refresh();
- binding = new Exadel.Menu.Layer.Binding (parent, offEvt, onmouseout);
+ binding = new RichFaces.Menu.Layer.Binding (parent, offEvt, onmouseout);
this.bindings.push(binding);
binding.refresh();
return this;
@@ -1097,8 +1097,8 @@
};
-Exadel.Menu.Layer.Binding = Class.create();
-Exadel.Menu.Layer.Binding.prototype = {
+RichFaces.Menu.Layer.Binding = Class.create();
+RichFaces.Menu.Layer.Binding.prototype = {
initialize:function(objectId, eventname, handler){
this.objectId = objectId;
this.eventname = eventname;
@@ -1115,14 +1115,14 @@
return false;
}
};
-if(!Exadel.Menu.Item) Exadel.Menu.Item = {};
+if(!RichFaces.Menu.Item) RichFaces.Menu.Item = {};
/**
*
*/
-Exadel.Menu.Item.Onclick = function(evt, item, action, params, target) {
+RichFaces.Menu.Item.Onclick = function(evt, item, action, params, target) {
var form = Event.findElement(evt, 'form');
-
+
/*if(!form || typeof(form) == 'undefined' || !form.nodeName || form.nodeName.toLowerCase() != 'form'){
form = document.createElement('form');
form.setAttribute('method', 'post');
@@ -1132,10 +1132,10 @@
}*/
var objectsCreated = new Array();
var oldValues = new Object();
- Exadel.Menu.Item._createOrInitHiddenInput(item + ":submit", item + ":submit", objectsCreated, oldValues, form);
-
+ RichFaces.Menu.Item._createOrInitHiddenInput(item + ":submit", item + ":submit", objectsCreated, oldValues, form);
+
if (params) {
-
+
for (var param in params) {
var paramName = param;
var paramValue = params[paramName];
@@ -1143,36 +1143,36 @@
if (paramValue) {
paramValue = String(paramValue);
}
- Exadel.Menu.Item._createOrInitHiddenInput(paramName, paramValue, objectsCreated, oldValues, form);
-
+ RichFaces.Menu.Item._createOrInitHiddenInput(paramName, paramValue, objectsCreated, oldValues, form);
+
}
}
}
-
+
var l = objectsCreated.length;
-
+
for (var i = 0; i < l; i++) {
var kid = objectsCreated[i];
form.appendChild(kid);
}
-
+
var targ = form.target;
-
+
if (target) {
form.target = target;
}
-
+
form.submit();
-
+
form.target = targ;
-
+
for (var j = 0; j < l; j++) {
var kid = objectsCreated[j];
if (form && kid) {
form.removeChild(kid);
}
}
-
+
for (var key in oldValues) {
var value = oldValues[key];
if (typeof(value) != 'function') {
@@ -1180,10 +1180,10 @@
}
}
}
-
-Exadel.Menu.Item._createOrInitHiddenInput = function(name, value, list, oldValues, form) {
+
+RichFaces.Menu.Item._createOrInitHiddenInput = function(name, value, list, oldValues, form) {
var hiddenObj = $(name) || form[name];
-
+
if (!hiddenObj) {
hiddenObj = document.createElement('input');
hiddenObj.setAttribute('type', 'hidden');
17 years, 7 months
JBoss Rich Faces SVN: r931 - trunk/docs/userguide/en/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-05-29 08:46:15 -0400 (Tue, 29 May 2007)
New Revision: 931
Modified:
trunk/docs/userguide/en/modules/RFClibrary.xml
Log:
used <para> instead of <section>
Modified: trunk/docs/userguide/en/modules/RFClibrary.xml
===================================================================
--- trunk/docs/userguide/en/modules/RFClibrary.xml 2007-05-29 12:36:18 UTC (rev 930)
+++ trunk/docs/userguide/en/modules/RFClibrary.xml 2007-05-29 12:46:15 UTC (rev 931)
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
-<section id="RichFacesComponentsLibrary" xreflabel="RichFacesComponentsLibrary">
+<para id="RichFacesComponentsLibrary" xreflabel="RichFacesComponentsLibrary">
<?dbhtml filename="RichFacesComponentsLibrary.html"?>
-</section>
+</para>
17 years, 7 months
JBoss Rich Faces SVN: r930 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-05-29 08:36:18 -0400 (Tue, 29 May 2007)
New Revision: 930
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
RF-229 fixed
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-05-29 12:35:36 UTC (rev 929)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-05-29 12:36:18 UTC (rev 930)
@@ -555,7 +555,8 @@
}
Exadel.Menu.DelayedPopUp.prototype.reposition = function() {
- var body = Exadel.Menu.getPageDimensions();
+ var windowShift = Exadel.Menu.getWindowScrollOffset();
+ var body = Exadel.Menu.getWindowDimensions();
var windowHeight = body.height;
var windowWidth = body.width;
var scrolls = {top:0, left:0};
@@ -584,8 +585,8 @@
var layerTop = top;
if (dir == 0) {
- if (layerLeft + layerdim.width + labelOffset[0] >= windowWidth) {
- var invisibleRight = layerLeft + layerdim.width + labelOffset[0] - windowWidth;
+ if (layerLeft + layerdim.width + labelOffset[0] - windowShift.left >= windowWidth) {
+ var invisibleRight = layerLeft + layerdim.width + labelOffset[0] - windowShift.left - windowWidth;
layerLeft = left - layerdim.width;
}
@@ -599,8 +600,8 @@
layerLeft = left - layerdim.width;
}
- if (layerTop + layerdim.height + labelOffset[1] >= windowHeight) {
- var invisibleBottom = layerTop + layerdim.height + labelOffset[1] - windowHeight;
+ if (layerTop + layerdim.height + labelOffset[1] - windowShift.top >= windowHeight) {
+ var invisibleBottom = layerTop + layerdim.height + labelOffset[1] - windowShift.top - windowHeight;
var items = this.layer.firstChild.childNodes;
if (items.length > 1) {
var lastItem = items[items.length-2];
17 years, 7 months
JBoss Rich Faces SVN: r929 - in trunk/richfaces/menu-components/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-05-29 08:35:36 -0400 (Tue, 29 May 2007)
New Revision: 929
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
Compact templates removing duplicated sections for enabled/disabled states.
Modified: trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
===================================================================
--- trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2007-05-29 12:35:15 UTC (rev 928)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2007-05-29 12:35:36 UTC (rev 929)
@@ -52,6 +52,24 @@
context, menuGroup);
}
+ public void initializeStyleClasses(FacesContext context, UIMenuGroup menuGroup) {
+ ComponentVariables variables =
+ ComponentsVariableResolver.getVariables(this, menuGroup);
+ if (menuGroup.isDisabled()) {
+ variables.setVariable("menuGroupClass", "dr-menu-item-disabled rich-menu-group-disabled");
+ variables.setVariable("menuGroupMouseMove", "");
+ variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-disabled");
+ variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label-disabled");
+ variables.setVariable("menuGroupItemFolderClass", "rich-menu-item-folder-disabled");
+ } else {
+ variables.setVariable("menuGroupClass", "dr-menu-item-enabled");
+ variables.setVariable("menuGroupMouseMove", menuGroup.getAttributes().get("onmousemove"));
+ variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-enabled");
+ variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label");
+ variables.setVariable("menuGroupItemFolderClass", "rich-menu-item-folder");
+ }
+ }
+
public void initializeResources(FacesContext context, UIMenuGroup menuGroup)
throws IOException {
ComponentVariables variables =
@@ -70,6 +88,9 @@
}
variables.setVariable("iconDisabled", iconDisabled);
+
+ String actualIcon = menuGroup.isDisabled() ? iconDisabled : icon;
+ variables.setVariable("actualIcon", actualIcon);
String iconFolder = ViewUtil.getResourceURL(menuGroup.getIconFolder());
if (iconFolder == null) {
@@ -84,5 +105,8 @@
}
variables.setVariable("iconFolderDisabled", iconFolderDisabled);
+
+ String actualIconFolder = menuGroup.isDisabled() ? iconFolderDisabled : iconFolder;
+ variables.setVariable("actualIconFolder", actualIconFolder);
}
}
Modified: trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-05-29 12:35:15 UTC (rev 928)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-05-29 12:35:36 UTC (rev 929)
@@ -96,6 +96,7 @@
if (menuItem.isDisabled()) {
variables.setVariable("iconDisabledClasses",
"dr-menu-icon-disabled rich-menu-item-icon-disabled");
+ variables.setVariable("menuItemLabelClass", "rich-menu-item-label rich-menu-item-label-disabled");
} else {
variables.setVariable("onmouseoutInlineStyles",
@@ -127,6 +128,7 @@
if (resource.length() > 0) {
variables.setVariable("onclick", scriptValue.toString());
}
+ variables.setVariable("menuItemLabelClass", "rich-menu-item-label");
}
}
Modified: trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
===================================================================
--- trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2007-05-29 12:35:15 UTC (rev 928)
+++ trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2007-05-29 12:35:36 UTC (rev 929)
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<f:root
- xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
- xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:u=" http://ajax4jsf.org/cdk/u"
- xmlns:x=" http://ajax4jsf.org/cdk/x"
- xmlns:vcp=" http://jsf.exadel.com/vcp"
- baseclass="org.richfaces.renderkit.html.MenuGroupRendererBase"
- class="org.richfaces.renderkit.html.MenuGroupRenderer"
- component="org.richfaces.component.UIMenuGroup"
- >
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:vcp=" http://jsf.exadel.com/vcp"
+ baseclass="org.richfaces.renderkit.html.MenuGroupRendererBase"
+ class="org.richfaces.renderkit.html.MenuGroupRenderer"
+ component="org.richfaces.component.UIMenuGroup" >
+
<h:styles>css/menucomponents.xcss</h:styles>
<h:scripts>
@@ -18,115 +18,71 @@
</h:scripts>
<f:clientid var="clientId"/>
- <f:call name="initializeResources" />
+ <f:call name="initializeResources" />
+ <f:call name="initializeStyleClasses" />
<f:resource name="/org/richfaces/renderkit/html/images/spacer.gif" var="spacer" />
- <jsp:scriptlet><![CDATA[
- boolean disabled = ((Boolean) component.getAttributes().get("disabled")).booleanValue();
- if (! disabled) {
- ]]></jsp:scriptlet>
- <div id="ref#{clientId}"
- class="dr-menu-item dr-menu-item-enabled rich-menu-group #{component.attributes['styleClass']}"
- style="#{component.attributes['style']}"
- onmousemove="#{component.attributes['onmousemove']}">
-
- <span id="ref#{clientId}:icon"
- class="dr-menu-icon rich-menu-item-icon #{component.attributes['iconClass']}">
- <jsp:scriptlet>
- <![CDATA[if(component.getFacet("icon")!=null && component.getFacet("icon").isRendered()) {]]>
- </jsp:scriptlet>
- <u:insertFacet name="icon" />
- <jsp:scriptlet>
- <![CDATA[} else if (component.getAttributes().get("icon")!=null) {]]>
- </jsp:scriptlet>
- <img width="16" height="16"
- style="#{component.attributes['iconStyle']}"
- src="#{icon}"/>
- <jsp:scriptlet>
- <![CDATA[} else {]]>
- </jsp:scriptlet>
- <img width="16" height="16"
- style="#{component.attributes['iconStyle']}"
- src="#{spacer}"/>
- <jsp:scriptlet><![CDATA[}]]></jsp:scriptlet>
- </span>
- <span id="ref#{clientId}:anchor" class="rich-menu-item-label">#{component.attributes['value']}</span>
-
- <jsp:scriptlet>
- <![CDATA[if(component.getFacet("iconFolder")!=null && component.getFacet("iconFolder").isRendered()) {]]>
- </jsp:scriptlet>
- <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder">
- <u:insertFacet name="iconFolder" />
- </div>
- <jsp:scriptlet>
- <![CDATA[} else if (component.getAttributes().get("iconFolder")!=null) {]]>
- </jsp:scriptlet>
- <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder #{component.attributes['iconClass']}">
- <img width="16" height="16"
- style="#{component.attributes['iconStyle']}"
- src="#{iconFolder}"/>
- </div>
- <jsp:scriptlet>
- <![CDATA[} else {]]>
- </jsp:scriptlet>
- <div id="ref#{clientId}:folder" class="dr-menu-node dr-menu-node-icon rich-menu-item-folder"/>
- <jsp:scriptlet>
- <![CDATA[}]]>
- </jsp:scriptlet>
- </div>
-
- <jsp:scriptlet><![CDATA[} else {]]></jsp:scriptlet>
- <div id="ref#{clientId}"
- class="dr-menu-item dr-menu-item-disabled rich-menu-group rich-menu-group-disabled #{component.attributes['styleClass']}"
- style="#{component.attributes['style']}">
-
- <span id="ref#{clientId}:icon"
- class="dr-menu-icon rich-menu-item-icon-disabled #{component.attributes['iconClass']}">
- <jsp:scriptlet>
- <![CDATA[if(component.getFacet("iconDisabled")!=null && component.getFacet("iconDisabled").isRendered()) {]]>
- </jsp:scriptlet>
- <u:insertFacet name="iconDisabled" />
- <jsp:scriptlet>
- <![CDATA[} else if (component.getAttributes().get("iconDisabled")!=null) {]]>
- </jsp:scriptlet>
- <img width="16" height="16"
- style="#{component.attributes['iconStyle']}"
- src="#{iconDisabled}"/>
- <jsp:scriptlet>
- <![CDATA[} else {]]>
- </jsp:scriptlet>
- <img width="16" height="16"
- style="#{component.attributes['iconStyle']}"
- src="#{spacer}"/>
- <jsp:scriptlet><![CDATA[}]]></jsp:scriptlet>
- </span>
-
- <span class="rich-menu-item-label-disabled">#{component.attributes['value']}</span>
+ <div id="ref#{clientId}"
+ class="dr-menu-item #{menuGroupClass} rich-menu-group #{component.attributes['styleClass']}"
+ style="#{component.attributes['style']}"
+ onmousemove="#{menuGroupMouseMove}">
+
+ <span id="ref#{clientId}:icon"
+ class="dr-menu-icon #{menuGroupItemIconClass} #{component.attributes['iconClass']}">
+ <jsp:scriptlet>
+ <![CDATA[
+ boolean disabled = ((Boolean) component.getAttributes().get("disabled")).booleanValue();
+ String iconFacet = disabled ? "iconDisabled" : "icon";
+ ComponentsVariableResolver.getVariables(this, component).setVariable("iconFacet", iconFacet);
+ if(component.getFacet(iconFacet)!=null && component.getFacet(iconFacet).isRendered()) {
+ ]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="#{iconFacet}" />
+ <jsp:scriptlet>
+ <![CDATA[} else if (component.getAttributes().get(iconFacet)!=null) {]]>
+ </jsp:scriptlet>
+ <img width="16" height="16"
+ style="#{component.attributes['iconStyle']}"
+ src="#{actualIcon}"/>
+ <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet>
+ <img width="16" height="16"
+ style="#{component.attributes['iconStyle']}"
+ src="#{spacer}"/>
+ <jsp:scriptlet><![CDATA[}]]></jsp:scriptlet>
+ </span>
- <jsp:scriptlet>
- <![CDATA[if(component.getFacet("iconFolderDisabled")!=null && component.getFacet("iconFolderDisabled").isRendered()) {]]>
- </jsp:scriptlet>
- <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder-disabled">
- <u:insertFacet name="iconFolderDisabled" />
- </div>
- <jsp:scriptlet>
- <![CDATA[} else if (component.getAttributes().get("iconFolderDisabled")!=null) {]]>
- </jsp:scriptlet>
- <div id="ref#{clientId}:folder" class="dr-menu-node rich-menu-item-folder-disabled #{component.attributes['iconClass']}">
- <img width="16" height="16"
- style="#{component.attributes['iconStyle']}"
- src="#{iconFolderDisabled}"/>
- </div>
- <jsp:scriptlet>
- <![CDATA[} else {]]>
- </jsp:scriptlet>
- <div id="ref#{clientId}:folder" class="dr-menu-node dr-menu-node-icon rich-menu-item-folder-disabled"/>
- <jsp:scriptlet>
- <![CDATA[}]]>
- </jsp:scriptlet>
+ <span id="ref#{clientId}:anchor" class="#{menuGroupItemLabelClass}">
+ #{component.attributes['value']}
+ </span>
+
+ <jsp:scriptlet>
+ <![CDATA[
+ String iconFolder = disabled ? "iconFolderDisabled" : "iconFolder";
+ ComponentsVariableResolver.getVariables(this, component).setVariable("iconFolder", iconFolder);
+ if(component.getFacet(iconFolder)!=null && component.getFacet(iconFolder).isRendered()) {
+ ]]>
+ </jsp:scriptlet>
+ <div id="ref#{clientId}:folder" class="dr-menu-node #{menuGroupItemFolderClass}">
+ <u:insertFacet name="#{iconFolder}" />
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[} else if (component.getAttributes().get(iconFolder)!=null) {]]>
+ </jsp:scriptlet>
+ <div id="ref#{clientId}:folder" class="dr-menu-node #{menuGroupItemFolderClass} #{component.attributes['iconClass']}">
+ <img width="16" height="16"
+ style="#{component.attributes['iconStyle']}"
+ src="#{actualIconFolder}"/>
</div>
-
- <jsp:scriptlet><![CDATA[}]]></jsp:scriptlet>
+ <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet>
+ <div id="ref#{clientId}:folder" class="dr-menu-node dr-menu-node-icon #{menuGroupItemFolderClass}"/>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+ </div>
</f:root>
\ No newline at end of file
Modified: trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2007-05-29 12:35:15 UTC (rev 928)
+++ trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2007-05-29 12:35:36 UTC (rev 929)
@@ -77,32 +77,13 @@
</span>
- <jsp:scriptlet><![CDATA[
- if (((org.richfaces.component.UIMenuItem) component).isDisabled()) {
- ]]></jsp:scriptlet>
-
- <span id="#{clientId}:disabled"
- class="rich-menu-item-label rich-menu-item-label-disabled"
+ <span id="#{clientId}:anchor"
+ class="#{menuItemLabelClass}"
>
#{component.attributes['value']}
<f:call name="renderChildren" />
</span>
-
- <jsp:scriptlet><![CDATA[
- } else {
- ]]></jsp:scriptlet>
-
- <span id="#{clientId}:anchor"
- class="rich-menu-item-label">
- #{component.attributes['value']}
- <f:call name="renderChildren" />
- </span>
-
- <jsp:scriptlet><![CDATA[
- }
- ]]></jsp:scriptlet>
-
-
+
<jsp:scriptlet><![CDATA[
if (((org.richfaces.component.UIMenuItem) component).isDisabled()) {
]]></jsp:scriptlet>
17 years, 7 months
JBoss Rich Faces SVN: r928 - trunk/docs/userguide/en.
by richfaces-svn-commits@lists.jboss.org
Author: afedosik
Date: 2007-05-29 08:35:15 -0400 (Tue, 29 May 2007)
New Revision: 928
Modified:
trunk/docs/userguide/en/master.xml
Log:
Modified: trunk/docs/userguide/en/master.xml
===================================================================
--- trunk/docs/userguide/en/master.xml 2007-05-29 11:56:52 UTC (rev 927)
+++ trunk/docs/userguide/en/master.xml 2007-05-29 12:35:15 UTC (rev 928)
@@ -9,6 +9,7 @@
<!ENTITY rfcarchitectover SYSTEM "modules/rfcarchitectover.xml">
<!ENTITY rfclibrary SYSTEM "modules/rfclibrary.xml">
+
<!ENTITY dataFilterSlider_table SYSTEM "../../build/generated/en/dataFilterSlider_table.xml">
<!ENTITY dataScroller_table SYSTEM "../../build/generated/en/datascroller_table.xml">
<!ENTITY dataTable_table SYSTEM "../../build/generated/en/dataTable_table.xml">
@@ -53,13 +54,15 @@
&rfctechreqs;
&rfcsetwebappl;
&rfcarchitectover;
-<chapter>
+
+<chapter role="NotInToc">
<title>The RichFaces Components</title>
<para>The library encompasses ready-made components built based on the <emphasis role="italic"><property>Ajax4jsf Component Factory</property></emphasis>. To find out more about the Component Factory, go to the
<ulink url="http://www.jboss.org/projects/jbossajax4jsf">Ajax4jsf project</ulink>.</para>
- &rfclibrary;
+ &rfclibrary;
+
&dataFilterSlider_table;
-&dataScroller_table;
+ &dataScroller_table;
&dataTable_table;
&dnd_table;
&gmap_table;
@@ -80,6 +83,7 @@
&dropDownMenu_table;
&menuComponents_table;
+
</chapter>
&rfcidesupport;
17 years, 7 months