JBoss Rich Faces SVN: r725 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-10 14:22:40 -0400 (Thu, 10 May 2007)
New Revision: 725
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-10 18:22:29 UTC (rev 724)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-10 18:22:40 UTC (rev 725)
@@ -6,8 +6,12 @@
import java.util.Iterator;
import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.PhaseId;
import org.ajax4jsf.ajax.repeat.UIRepeat;
+import org.ajax4jsf.framework.ajax.AjaxEvent;
import org.apache.commons.collections.iterators.IteratorChain;
@@ -18,6 +22,9 @@
public class UIScrollableGrid extends UIRepeat{
+ public UIScrollableGrid() {
+ super();
+ }
protected Iterator dataChildren() {
@@ -48,8 +55,10 @@
return chain;
}
- public Object getValue() {
- // TODO Auto-generated method stub
- return super.getValue();
+ public void queueEvent(FacesEvent event) {
+ if(event instanceof AjaxEvent){
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ }
+ super.queueEvent(event);
}
}
17 years, 7 months
JBoss Rich Faces SVN: r724 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-10 14:22:29 -0400 (Thu, 10 May 2007)
New Revision: 724
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-05-10 18:22:20 UTC (rev 723)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-05-10 18:22:29 UTC (rev 724)
@@ -1,17 +1,21 @@
package org.richfaces.renderkit.html;
import java.io.IOException;
+import java.util.Map;
import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.ajax.repeat.DataVisitor;
import org.ajax4jsf.framework.ajax.AjaxContext;
+import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
import org.ajax4jsf.framework.renderer.ComponentVariables;
import org.ajax4jsf.framework.renderer.ComponentsVariableResolver;
import org.ajax4jsf.framework.renderer.RendererBase;
import org.ajax4jsf.framework.renderer.RendererUtils.HTML;
+import org.ajax4jsf.framework.util.javascript.JSFunction;
import org.richfaces.component.UIScrollableGrid;
import org.richfaces.component.UIScrollableGridColumn;
import org.richfaces.renderkit.CompositeRenderer;
@@ -31,6 +35,8 @@
private final RendererBase cellTemplate = TemplateLoader.loadTemplate("org.richfaces.renderkit.html.ScrollableGridCellRenderer");
+
+
private final ColumnVisitor headerRenderer = new ColumnVisitor(){
public void visit(FacesContext context, UIScrollableGridColumn column,
@@ -110,6 +116,10 @@
final GridRendererState state = GridRendererState.getRendererState(context);
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
+// variables.setVariable("column_count", variable);
+ variables.setVariable("rows_count", new Integer(component.getRows()));
+
writer.startElement(HTML.DIV_ELEM, grid);
getUtils().writeAttribute(writer, "class","GridDataColumns");
getUtils().writeAttribute(writer, "id","FrozenBox");
@@ -160,13 +170,11 @@
state.set_isFrozenColumn(false);
grid.walk(context, rowsRenderer, state);
-
writer.endElement("tbody");
writer.endElement("table");
writer.endElement(HTML.DIV_ELEM);
+ grid.setRowKey(null);
-
-
}
public void renderHeaders(FacesContext context, UIComponent component
@@ -189,9 +197,36 @@
public void tearDownState(FacesContext context){
GridRendererState.restoreState(context);
- }
+ }
+ public String getRowsAjaxUpdate(FacesContext context, UIScrollableGrid grid){
+ JSFunction function = AjaxRendererUtils.buildAjaxFunction(grid, context);
+ Map options = AjaxRendererUtils.buildEventOptions(context, grid);
+
+ function.addParameter(options);
+ String completeFunction = function.toScript()+"; return false;";
+ return completeFunction;
+ }
+ protected void doDecode(FacesContext context, UIComponent component) {
+
+ String value = null;
+
+ if(component instanceof UIScrollableGrid){
+ UIScrollableGrid grid = (UIScrollableGrid)component;
+ ExternalContext externalContext = context.getExternalContext();
+ String clientId = grid.getClientId(context) + "_state_input";
+
+ Map parameters = externalContext.getRequestParameterMap();
+ if(parameters.containsKey(clientId)){
+ value = (String)parameters.get(clientId);
+
+ }
+ }
+ super.doDecode(context, component);
+ }
+
+
// for benchmark
public void encodeBegin(FacesContext context, UIComponent component
) throws IOException {
@@ -211,6 +246,8 @@
}
}
+
+
public void encodeChildren(FacesContext context, UIComponent component
) throws IOException {
17 years, 7 months
JBoss Rich Faces SVN: r723 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-10 14:22:20 -0400 (Thu, 10 May 2007)
New Revision: 723
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-10 18:22:06 UTC (rev 722)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody2.js 2007-05-10 18:22:20 UTC (rev 723)
@@ -77,7 +77,7 @@
_onDataReady: function(options) {
// load rows data
var currTime = (new Date()).getTime();
-
+ /*
var loadRow = this.loadRow.bind(this);
var byIndex = options.indexes!==null;
var count = options.indexes!==null ? options.indexes.length : (options.ids!==null?options.ids.lenth : 0);
@@ -91,12 +91,13 @@
if(ClientUILib.isIE && !ClientUILib.isIE7) {
this.setScrollPos(this.currentPos);
this.adjustScrollPosition(this.grid.getColumnScrollX());
- }
-
- ClientUILib.log(ClientUILogger.WARNING, "data for "+count+" rows loaded over: " + ((new Date()).getTime() - currTime) + " miliseconds.");
+ }
+ */
+
+ ClientUILib.log(ClientUILogger.WARNING, "data for "+options.count+" rows loaded over: " + ((new Date()).getTime() - currTime) + " miliseconds.");
+ ClientUILib.log(ClientUILogger.WARNING, "start index: " + options.index + ", and startRow: " + options.startRow);
ClientUILib.log(ClientUILogger.WARNING, "load data delta time: " + (this.taskStartTime - this.taskDefineTime));
ClientUILib.log(ClientUILogger.WARNING, "data prepare time: " + (this.taskStartLoadingTime - this.taskStartTime));
- ClientUILib.log(ClientUILogger.INFO, "Load data indexes: " + options.ids.inspect());
},
registerEvents: function() {
Event.observe(this.scrollBox.eventHScroll, "grid body hscroll", this._eventOnHScroll);
@@ -185,7 +186,11 @@
for(var i=0; i<this.rowsCount; i++) {
templFrozen.rows[i].index = i;
templNormal.rows[i].index = i;
- }
+ }
+ this.countToLoad = 0;
+ this.startRow = 0;
+ this.startIndex = 0;
+
return true;
},
updateColumns: function() {
@@ -533,7 +538,7 @@
}
return this.pendingTask;
},
- _setPendingTask: function(task) {
+ _setPendingTask: function(task) {
// and plan other agjusting over the time
this.taskDefineTime = (new Date()).getTime();
task.timer = setTimeout(function() {
@@ -554,29 +559,34 @@
switchRows = false;
}
+ this.startIndex = range.start;
+ this.countToLoad = range.end - range.start;
+
if(!switchRows) {
+ this.startRow = this.templFrozen.getElement().rows[0].index;
+
this.prepareRows(0, range.end - range.start);
var pos = this.defaultRowHeight * range.start;
this.templFrozen.moveToY(pos);
this.templNormal.moveToY(pos);
}
else {
- var count = 0, i, row, rownew;
-
+ var i, row, rownew;
+ this.countToLoad = 0;
var frozenTbl = this.templFrozen.getElement().tBodies[0];
var normalTbl = this.templNormal.getElement().tBodies[0];
-
if(range.start > this.currRange.start
- && range.start < this.currRange.end) {
+ && range.start < this.currRange.end) {
// TODO: get rows from this.currRange.start to range.start
// and move them to end of table
// then move table to correct position
- count = range.start - this.currRange.start;
+ this.countToLoad = range.start - this.currRange.start;
+ this.startRow = frozenTbl.rows[0].index;
// store visible row pos to restore after rows reerrange
- var visibleRowPos = this.templFrozen.getY() + count * this.defaultRowHeight;
+ var visibleRowPos = this.templFrozen.getY() + this.countToLoad * this.defaultRowHeight;
- for(i=0; i<count; i++) {
+ for(i=0; i<this.countToLoad; i++) {
row = frozenTbl.rows[0];
frozenTbl.deleteRow(row);
rownew = frozenTbl.insertRow(this.rowsCount-1);
@@ -589,7 +599,7 @@
}
this.templFrozen.moveToY(visibleRowPos);
- this.templNormal.moveToY(visibleRowPos);
+ this.templNormal.moveToY(visibleRowPos);
/*
// prepare array of column elements for sorting
var count = this.body.rows.length;
@@ -664,6 +674,13 @@
indexes: rowsToLoadIdx,
ids: rowsToLoad});
*/
+
+ this.taskStartLoadingTime = (new Date()).getTime();
+ // 4. start data loading
+ this.grid.dataModel.loadRows({
+ index: this.startIndex,
+ count: this.countToLoad,
+ startRow: this.startRow});
clearTimeout(task.timer);
task.timer = null;
17 years, 7 months
JBoss Rich Faces SVN: r722 - trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-10 14:22:06 -0400 (Thu, 10 May 2007)
New Revision: 722
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-10 14:07:47 UTC (rev 721)
+++ trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-10 18:22:06 UTC (rev 722)
@@ -20,15 +20,43 @@
<h:scripts>
new org.ajax4jsf.framework.resource.PrototypeScript(),
+ new org.ajax4jsf.framework.ajax.AjaxScript(),
/org/richfaces/renderkit/html/scripts/scrollable-grid.js
</h:scripts>
+ <f:clientId var="clientId" />
+
+
+ <div id="#{clientId}_GridContainer" style="width: 90%; height:500px;" class="ClientUI_Grid">
+ <div id="#{clientId}_GridHeaderTemplate">
+ <table class="TestGridHeader" cellpadding="0" cellspacing="0" border="1">
+ <tbody>
+ <f:call name="renderHeaders"/>
+ </tbody>
+ </table>
+ </div>
+ <div id="#{clientId}_GridBodyTemplate">
+ <vcp:body/>
+ </div>
+ <f:clientId var="clientId" />
+ <div id="#{clientId}_GridFooterTemplate">
+ <table cellpadding="0" cellspacing="0">
+ <tbody>
+ <f:call name="renderFooters"/>
+ </tbody>
+ </table>
+ </div>
+ <input type="hidden" name="#{clientId}_state_input" id="#{clientId}_state_input"/>
+ <input type="button" name="#{clientId}_submit_input" id="#{clientId}_submit_input" onclick="#{this:getRowsAjaxUpdate(context,component)}" style="display:none"/>
+
+ </div>
- <script type="text/javascript">
+ <f:call name="tearDownState"/>
+
+
+ <script id="#{clientId}_model_create_scripts" type="text/javascript">
//<![CDATA[
-
-
ClientUI.controls.grid.FakeArrayDataModel = Class.create({
CLASSDEF: {
name: 'ClientUI.controls.grid.FakeArrayDataModel',
@@ -37,16 +65,17 @@
});
Object.extend(ClientUI.controls.grid.FakeArrayDataModel.prototype, {
- initialize: function(rows_count, columns_count) {
+ initialize: function(rows_count, columns_count, grid_id) {
ClientUI.controls.grid.FakeArrayDataModel.parentClass.constructor().call(this);
this.data = [];
this.count = rows_count;
this.columns = columns_count;
+ this.gridId = grid_id;
},
getRow: function(index) {
if(!this.data[index]) {
this.data[index] = [];
- for (var index2 = 0; index2 < 18; index2++) {
+ for (var index2 = 0; index2 < 7; index2++) {
this.data[index][index2] = index2 + " : " + index;
}
this.data[index][6] = index%2 ? "value 1" : "value 2";
@@ -59,12 +88,21 @@
},
getRequestDelay: function() {
return 50;
+ },
+
+ loadRows: function(options) {
+ var state_options = options;
+ var state_input = $(this.gridId + "_state_input");
+ var submit_input = $(this.gridId + "_submit_input");
+ var submit_values = state_options.count + "," + state_options.index + "," + state_options.startRow;
+ state_input.value = submit_values;
+ submit_input.click();
}
});
// ]]>
</script>
- <script type="text/javascript">
+ <script id="#{clientId}_grid_create_scripts" type="text/javascript">
//<![CDATA[
@@ -73,20 +111,23 @@
init : function() {
var currTime = (new Date()).getTime();
// ClientUILib.log(ClientUILogger.WARNING, "Document loaded over " + (currTime - ClientUILib.startTime) + " miliseconds.");
-
- dataModel = new ClientUI.controls.grid.FakeArrayDataModel(1000, 18);
+ var clientId = '#{clientId}';
+ var rows_count = '#{rows_count}';
+ // var column_count = '#{row_column}';
+
+ dataModel = new ClientUI.controls.grid.FakeArrayDataModel(1000, 8, clientId);
var templates = [
- {pane: GridLayout_Enum.HEADER, ref: "GridHeaderTemplate"},
- {pane: GridLayout_Enum.BODY, ref: "GridBodyTemplate"},
- {pane: GridLayout_Enum.FOOTER, ref: "GridFooterTemplate"}
+ {pane: GridLayout_Enum.HEADER, ref: clientId +"_" + "GridHeaderTemplate"},
+ {pane: GridLayout_Enum.BODY, ref: clientId +"_" + "GridBodyTemplate"},
+ {pane: GridLayout_Enum.FOOTER, ref: clientId +"_" + "GridFooterTemplate"}
];
// ClientUILib.log(ClientUILogger.WARNING, "DataModel created over " + ((new Date()).getTime() - currTime) + " miliseconds.");
// currTime = (new Date()).getTime();
// create the Grid
- grid = new ClientUI.controls.grid.Grid2('GridContainer', dataModel, templates,
+ grid = new ClientUI.controls.grid.Grid2(clientId +"_" + 'GridContainer', dataModel, templates,
{
showIndexColumn: false,
indexColumnWidth: 40
@@ -112,31 +153,6 @@
// ]]>
</script>
-
-
- <div id="GridContainer" style="width: 90%; height:500px;" class="ClientUI_Grid">
- <div id="GridHeaderTemplate">
- <table class="TestGridHeader" cellpadding="0" cellspacing="0" border="1">
- <tbody>
- <f:call name="renderHeaders"/>
- </tbody>
- </table>
- </div>
- <div id="GridBodyTemplate">
- <vcp:body/>
- </div>
- <div id="GridFooterTemplate">
- <table cellpadding="0" cellspacing="0">
- <tbody>
- <f:call name="renderFooters"/>
- </tbody>
- </table>
- </div>
- </div>
- <f:clientId var="clientId" />
- <c:set var="inputType" value="hidden"/>
- <input type="#{inputType}" name="#{clientId}_range" id="#{clientId}_range"/>
- <f:call name="tearDownState"/>
</f:root>
17 years, 7 months
JBoss Rich Faces SVN: r721 - trunk/docs/userguide/en/included.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-05-10 10:07:47 -0400 (Thu, 10 May 2007)
New Revision: 721
Modified:
trunk/docs/userguide/en/included/dropDownMenu.xml
Log:
Modified: trunk/docs/userguide/en/included/dropDownMenu.xml
===================================================================
--- trunk/docs/userguide/en/included/dropDownMenu.xml 2007-05-10 13:43:42 UTC (rev 720)
+++ trunk/docs/userguide/en/included/dropDownMenu.xml 2007-05-10 14:07:47 UTC (rev 721)
@@ -103,7 +103,7 @@
The"action" and "actionListener" item's attributes are ignored. Menu items don't fire any submits itself. Behavior is fully defined by the components nested into items.
</para>
<note><title>Note:</title>
- As the <rich:dropDownMenu> component doesn't provide its own form, use it in <form>-</h:form>.
+ As the <rich:dropDownMenu> component doesn't provide its own form, use it in <form>...</h:form>.
</note>
<para>
The "direction" and "jointPoint" attributes are used for the definition ways of menu appearance as it's shown in the example below.
17 years, 7 months
JBoss Rich Faces SVN: r720 - trunk/docs/userguide/en/included.
by richfaces-svn-commits@lists.jboss.org
Author: sabrashevich
Date: 2007-05-10 09:43:42 -0400 (Thu, 10 May 2007)
New Revision: 720
Modified:
trunk/docs/userguide/en/included/dataFilterSlider.xml
Log:
minor change
Modified: trunk/docs/userguide/en/included/dataFilterSlider.xml
===================================================================
--- trunk/docs/userguide/en/included/dataFilterSlider.xml 2007-05-10 13:31:32 UTC (rev 719)
+++ trunk/docs/userguide/en/included/dataFilterSlider.xml 2007-05-10 13:43:42 UTC (rev 720)
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<section>
- <section>
+
<table>
<title>Component identification parameters </title>
<tgroup cols="2">
@@ -34,7 +34,7 @@
</tbody>
</tgroup>
</table>
- </section>
+
<section>
<title>Creating the Component with a Page Tag</title>
<para> To create the simplest variant on a page, use the following syntax: </para>
17 years, 7 months
JBoss Rich Faces SVN: r719 - trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-05-10 09:31:32 -0400 (Thu, 10 May 2007)
New Revision: 719
Modified:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
Fix modal panel for Safari ( http://jira.jboss.com/jira/browse/RF-169 ).
Modified: trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-05-10 13:21:14 UTC (rev 718)
+++ trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-05-10 13:31:32 UTC (rev 719)
@@ -8,11 +8,12 @@
return elt.currentStyle[propertyName];
}
- if (document.defaultView && document.defaultView.getComputedStyle) {
+ if (document.defaultView && document.defaultView.getComputedStyle &&
+ document.defaultView.getComputedStyle(elt, null)) {
return document.defaultView.getComputedStyle(elt, null).getPropertyValue(propertyName);
}
- return {};
+ return "";
};
Richfaces.getComputedStyleSize = function(eltId, propertyName) {
17 years, 7 months
JBoss Rich Faces SVN: r718 - trunk/sandbox/scrollable-grid/design/funcspec.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-05-10 09:21:14 -0400 (Thu, 10 May 2007)
New Revision: 718
Modified:
trunk/sandbox/scrollable-grid/design/funcspec/FuncSpec - Invision Scrollable Grid Component.doc
Log:
Modified: trunk/sandbox/scrollable-grid/design/funcspec/FuncSpec - Invision Scrollable Grid Component.doc
===================================================================
(Binary files differ)
17 years, 7 months
JBoss Rich Faces SVN: r717 - trunk/sandbox/scrollable-grid/design/funcspec.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-05-10 07:46:19 -0400 (Thu, 10 May 2007)
New Revision: 717
Modified:
trunk/sandbox/scrollable-grid/design/funcspec/FuncSpec - Invision Scrollable Grid Component.doc
Log:
Modified: trunk/sandbox/scrollable-grid/design/funcspec/FuncSpec - Invision Scrollable Grid Component.doc
===================================================================
(Binary files differ)
17 years, 7 months
JBoss Rich Faces SVN: r716 - in trunk/sandbox/scrollable-grid: design and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-05-10 06:55:26 -0400 (Thu, 10 May 2007)
New Revision: 716
Added:
trunk/sandbox/scrollable-grid/design/
trunk/sandbox/scrollable-grid/design/funcspec/
trunk/sandbox/scrollable-grid/design/funcspec/FuncSpec - Invision Scrollable Grid Component.doc
Log:
Property changes on: trunk/sandbox/scrollable-grid/design/funcspec
___________________________________________________________________
Name: svn:ignore
+ ~$ncSpec - Invision Scrollable Grid Component.doc
Added: trunk/sandbox/scrollable-grid/design/funcspec/FuncSpec - Invision Scrollable Grid Component.doc
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/scrollable-grid/design/funcspec/FuncSpec - Invision Scrollable Grid Component.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 7 months