Author: abelevich
Date: 2007-05-21 07:18:50 -0400 (Mon, 21 May 2007)
New Revision: 812
Added:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
Removed:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cells2.jspx
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid2.jspx
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-footer-cell.jspx
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
Log:
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx 2007-05-21
10:36:48 UTC (rev 811)
+++
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx 2007-05-21
11:18:50 UTC (rev 812)
@@ -12,8 +12,8 @@
<td class="ClientUI_Grid_BC" id="#{client_id}:c_#{cell_id}">
- <span style="width: #{component.attributes['width']}"
id="#{client_id}:#{column_type}:bc_#{cell_index}_#{row_index}"
class="ClientUI_Grid_BCBody1">
- <span class="ClientUI_Grid_FCBody"
id="#{client_id}:#{column_type}:bcc_#{cell_id}">
+ <span style="width: #{component.attributes['width']}"
id="#{client_id}:bc_#{cell_index}" class="ClientUI_Grid_BCBody1">
+ <span class="ClientUI_Grid_FCBody"
id="#{client_id}:bc_#{cell_id}">
<vcp:body/>
</span>
</span>
Deleted:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cells2.jspx
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cells2.jspx 2007-05-21
10:36:48 UTC (rev 811)
+++
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cells2.jspx 2007-05-21
11:18:50 UTC (rev 812)
@@ -1,21 +0,0 @@
-<?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:h="
http://ajax4jsf.org/cdk/headers"
-
xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
- class="org.richfaces.renderkit.html.ScrollableGridCellRenderer"
- component="javax.faces.component.UIComponent"
- >
- <f:clientId var="clientId" />
-
- <td id="#{client_id}:c_#{cell_id}" class="ClientUI_Grid_BC">
- <span id="#{client_id}:bc_#{cell_id}" style="width:
#{component.attributes['width']}" class="ClientUI_Grid_BCBody">
- <vcp:body/>
- </span>
- </td>
-
-</f:root>
\ No newline at end of file
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-footer-cell.jspx
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-footer-cell.jspx 2007-05-21
10:36:48 UTC (rev 811)
+++
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-footer-cell.jspx 2007-05-21
11:18:50 UTC (rev 812)
@@ -12,7 +12,7 @@
<td class="ClientUI_Grid_FC">
- <span style="width: #{component.attributes['width']}"
id="#{client_id}:fc_#{cell_id}" class="ClientUI_Grid_FCBody1">
+ <span style="width: #{component.attributes['width']}"
id="#{client_id}:fc_#{cell_index}" class="ClientUI_Grid_FCBody1">
<span class="ClientUI_Grid_FCBody">
<vcp:body/>
</span>
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-05-21
10:36:48 UTC (rev 811)
+++
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-05-21
11:18:50 UTC (rev 812)
@@ -11,8 +11,8 @@
component="javax.faces.component.UIComponent"
- <td class="ClientUI_Grid_HC" id="#{client_id}hc_#{cell_id}">
- <span style="width: #{component.attributes['width']}"
id="#{client_id}:hcc_#{cell_id}" class="ClientUI_Grid_HCBody1">
+ <td class="ClientUI_Grid_HC"
id="#{client_id}:hc_#{cell_index}">
+ <span style="width: #{component.attributes['width']}"
id="#{client_id}:hcc_#{cell_index}" class="ClientUI_Grid_HCBody1">
<span id="#{clientId}:hcb_#{cell_index}"
class="ClientUI_Grid_HCBody">
<table width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
@@ -33,7 +33,12 @@
</table>
</span>
</span>
- <span column="#{cell_index}"
id="#{client_id}:hsep_#{cell_index}" style="left: ${sepOffset - 3}px;"
class="ClientUI_Grid_HSep" />
+ <jsp:scriptlet>
+
+ int offset = ((Integer)variables.getVariable("sepOffset")).intValue() - 3;
+
+ </jsp:scriptlet>
+ <span column="#{cell_index}"
id="#{client_id}:hsep_#{cell_index}" style="left: #{offset}px;"
class="ClientUI_Grid_HSep" />
</td>
</f:root>
\ No newline at end of file
Deleted:
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-21
10:36:48 UTC (rev 811)
+++
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-21
11:18:50 UTC (rev 812)
@@ -1,158 +0,0 @@
-<?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:h="
http://ajax4jsf.org/cdk/headers"
-
xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
- class="org.richfaces.renderkit.html.ScrollableGridRenderer"
- baseclass="org.richfaces.renderkit.html.ScrollableGridBaseRenderer"
- component="org.richfaces.component.UIScrollableGrid"
- >
-
- <h:styles>
- /org/richfaces/renderkit/html/css/grid.xcss
- </h:styles>
-
- <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="hidden" name="#{clienId}_rows_input"
id="#{clientId}_rows_input" value="#{rows_count}"/>
- <input type="button" name="#{clientId}_submit_input"
id="#{clientId}_submit_input"
onclick="#{this:getRowsAjaxUpdate(context,component)}"
style="display:none"/>
-
- </div>
-
- <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',
- parent: ClientUI.controls.grid.DataModel
- }
- });
-
- Object.extend(ClientUI.controls.grid.FakeArrayDataModel.prototype, {
- 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 < 7; index2++) {
- this.data[index][index2] = index2 + " : " + index;
- }
- this.data[index][6] = index%2 ? "value 1" : "value 2";
- }
-
- return this.data[index];
- },
- getCount: function() {
- return this.count;
- },
- 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 id="#{clientId}_grid_create_scripts"
type="text/javascript">
- //<![CDATA[
-
-
- var #{this:getJavaScriptVarName(context, component)} = function() {
- return {
- init : function() {
- var currTime = (new Date()).getTime();
- // ClientUILib.log(ClientUILogger.WARNING, "Document loaded over " +
(currTime - ClientUILib.startTime) + " miliseconds.");
- var clientId = '#{clientId}';
- var rows_count = $(clientId + "_rows_input").value;
- var columns_count = '#{columns_count}';
-
- dataModel = new ClientUI.controls.grid.FakeArrayDataModel(rows_count,
columns_count, clientId);
-
- var templates = [
- {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(clientId +"_" +
'GridContainer', dataModel, templates,
- {
- showIndexColumn: false,
- indexColumnWidth: 40
- }
- );
- // ClientUILib.log(ClientUILogger.WARNING, "Grid control created over " +
((new Date()).getTime() - currTime) + " miliseconds.");
-
- grid.updateLayout();
-
- setTimeout(function() {
- currTime = (new Date()).getTime();
- //grid.loadData();
- }.bind(this), 100);
-
- // ClientUILib.log(ClientUILogger.WARNING, "Done.");
- }
-
- }
- }();
-
- #{this:getScriptContributions(context, component)};
- Event.observe(window, 'load', #{this:getJavaScriptVarName(context,
component)}.init);
-
-// ]]>
- </script>
-</f:root>
-
-
-
\ No newline at end of file
Added:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
(rev 0)
+++
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-21
11:18:50 UTC (rev 812)
@@ -0,0 +1,235 @@
+<?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:h="
http://ajax4jsf.org/cdk/headers"
+
xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.ScrollableGridRenderer"
+ baseclass="org.richfaces.renderkit.html.ScrollableGridBaseRenderer"
+ component="org.richfaces.component.UIScrollableGrid"
+ >
+
+ <h:styles>
+ /org/richfaces/renderkit/html/css/grid.xcss
+ </h:styles>
+
+ <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" />
+
+ <f:call name="setUpColumnsWidth"/>
+
+ <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']};">
+ <div style="display: block; left: 0px; top: 0px; width:
#{sumWidth}px;">
+ <span class="ClientUI_TmplBox" id="FrozenBox">
+ <table cellpadding="0" cellspacing="0">
+ <tbody>
+ <tr class="ClientUI_Grid_HR">
+ <jsp:scriptlet>
+ <![CDATA[
+ renderHeaders(context, component, true);
+ ]]>
+ </jsp:scriptlet>
+ </tr>
+ </tbody>
+ </table>
+ </span>
+
+ <span class="ClientUI_TmplBox" id="NormalBox">
+ <table cellpadding="0" cellspacing="0">
+ <tbody>
+ <tr class="ClientUI_Grid_HR">
+ <jsp:scriptlet>
+ <![CDATA[
+ renderHeaders(context, component, false);
+ ]]>
+ </jsp:scriptlet>
+ </tr>
+ </tbody>
+ </table>
+ </span>
+ </div>
+ </div>
+
+ <div id="#{clientId}_GridBodyTemplate"
class="ClientUI_InlineBox" style="overflow: auto; width:
#{component.attributes['width']}; height:
#{component.attributes['height']};">
+ <div style="display: block; width: #{sumWidth}px;">
+ <span class="ClientUI_TmplBox" id="FrozenBox">
+ <table cellpadding="0" cellspacing="0">
+ <tbody>
+ <jsp:scriptlet>
+ <![CDATA[
+ renderGridBody(context, component, true);
+ ]]>
+ </jsp:scriptlet>
+ </tbody>
+ </table>
+ </span>
+ <span class="ClientUI_TmplBox" id="NormalBox">
+ <table cellpadding="0" cellspacing="0">
+ <tbody>
+ <jsp:scriptlet>
+ <![CDATA[
+ renderGridBody(context, component, false);
+ ]]>
+ </jsp:scriptlet>
+ </tbody>
+ </table>
+ </span>
+ </div>
+ </div>
+
+ <div id="#{clientId}_GridFooterTemplate"
class="ClientUI_InlineBox" style="width:
#{component.attributes['width']};">
+ <div style="display: block; width: width: #{sumWidth}px;">
+ <span class="ClientUI_TmplBox" id="FrozenBox">
+ <table cellpadding="0" cellspacing="0">
+ <tbody>
+ <tr class="ClientUI_Grid_FR">
+ <jsp:scriptlet>
+ <![CDATA[
+ renderFooters(context, component,true);
+ ]]>
+ </jsp:scriptlet>
+ </tr>
+ </tbody>
+ </table>
+ </span>
+
+ <span class="ClientUI_TmplBox" id="NormalBox">
+ <table cellpadding="0" cellspacing="0">
+ <tbody>
+ <tr class="ClientUI_Grid_FR">
+ <jsp:scriptlet>
+ <![CDATA[
+ renderFooters(context, component,false);
+ ]]>
+ </jsp:scriptlet>
+ </tr>
+ </tbody>
+ </table>
+ </span>
+ </div>
+ </div>
+
+ <input type="hidden" name="#{clientId}_state_input"
id="#{clientId}_state_input"/>
+ <input type="hidden" name="#{clienId}_rows_input"
id="#{clientId}_rows_input" value="#{rows_count}"/>
+ <input type="button" name="#{clientId}_submit_input"
id="#{clientId}_submit_input"
onclick="#{this:getRowsAjaxUpdate(context,component)}"
style="display:none"/>
+
+ </div>
+
+ <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',
+ parent: ClientUI.controls.grid.DataModel
+ }
+ });
+
+ Object.extend(ClientUI.controls.grid.FakeArrayDataModel.prototype, {
+ 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 < 7; index2++) {
+ this.data[index][index2] = index2 + " : " + index;
+ }
+ this.data[index][6] = index%2 ? "value 1" : "value 2";
+ }
+
+ return this.data[index];
+ },
+ getCount: function() {
+ return this.count;
+ },
+ 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 id="#{clientId}_grid_create_scripts"
type="text/javascript">
+ //<![CDATA[
+
+
+ var #{this:getJavaScriptVarName(context, component)} = function() {
+ return {
+ init : function() {
+ var currTime = (new Date()).getTime();
+ // ClientUILib.log(ClientUILogger.WARNING, "Document loaded over " +
(currTime - ClientUILib.startTime) + " miliseconds.");
+ var clientId = '#{clientId}';
+ var rows_count = $(clientId + "_rows_input").value;
+ var columns_count = '#{columns_count}';
+
+ dataModel = new ClientUI.controls.grid.FakeArrayDataModel(rows_count,
columns_count, clientId);
+
+ var templates = [
+ {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.Grid(clientId +"_" +
'GridContainer', dataModel, templates,
+ {
+ showIndexColumn: false,
+ indexColumnWidth: 40
+ }
+ );
+
+ // function onColumnResize(column, width) {call to ajax4jsf}
+ //Event.observe(grid.eventOnResizeColumn, "", onColumnResize);
+
+ // ClientUILib.log(ClientUILogger.WARNING, "Grid control created over " +
((new Date()).getTime() - currTime) + " miliseconds.");
+
+ grid.updateLayout();
+
+ setTimeout(function() {
+ currTime = (new Date()).getTime();
+ //grid.loadData();
+ }.bind(this), 100);
+
+ // ClientUILib.log(ClientUILogger.WARNING, "Done.");
+ }
+
+ }
+ }();
+
+ #{this:getScriptContributions(context, component)};
+ Event.observe(window, 'load', #{this:getJavaScriptVarName(context,
component)}.init);
+
+// ]]>
+ </script>
+</f:root>
+
+
+
\ No newline at end of file
Deleted:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid2.jspx
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid2.jspx 2007-05-21
10:36:48 UTC (rev 811)
+++
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid2.jspx 2007-05-21
11:18:50 UTC (rev 812)
@@ -1,231 +0,0 @@
-<?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:h="
http://ajax4jsf.org/cdk/headers"
-
xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
- class="org.richfaces.renderkit.html.ScrollableGridRenderer"
- baseclass="org.richfaces.renderkit.html.ScrollableGridBaseRenderer2"
- component="org.richfaces.component.UIScrollableGrid"
- >
-
- <h:styles>
- /org/richfaces/renderkit/html/css/grid.xcss
- </h:styles>
-
- <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" />
-
- <f:call name="setUpColumnsWidth"/>
-
- <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']};">
- <div style="display: block; left: 0px; top: 0px; width:
#{sumWidth}px;">
- <span class="ClientUI_TmplBox" id="FrozenBox">
- <table cellpadding="0" cellspacing="0">
- <tbody>
- <tr class="ClientUI_Grid_HR">
- <jsp:scriptlet>
- <![CDATA[
- renderHeaders(context, component, true);
- ]]>
- </jsp:scriptlet>
- </tr>
- </tbody>
- </table>
- </span>
-
- <span class="ClientUI_TmplBox" id="NormalBox">
- <table cellpadding="0" cellspacing="0">
- <tbody>
- <tr class="ClientUI_Grid_HR">
- <jsp:scriptlet>
- <![CDATA[
- renderHeaders(context, component, false);
- ]]>
- </jsp:scriptlet>
- </tr>
- </tbody>
- </table>
- </span>
- </div>
- </div>
-
- <div id="#{clientId}_GridBodyTemplate"
class="ClientUI_InlineBox" style="overflow: auto; width:
#{component.attributes['width']}; height:
#{component.attributes['height']};">
- <div style="display: block; width: #{sumWidth}px;">
- <span class="ClientUI_TmplBox" id="FrozenBox">
- <table cellpadding="0" cellspacing="0">
- <tbody>
- <jsp:scriptlet>
- <![CDATA[
- renderGridBody(context, component, true);
- ]]>
- </jsp:scriptlet>
- </tbody>
- </table>
- </span>
- <span class="ClientUI_TmplBox" id="NormalBox">
- <table cellpadding="0" cellspacing="0">
- <tbody>
- <jsp:scriptlet>
- <![CDATA[
- renderGridBody(context, component, false);
- ]]>
- </jsp:scriptlet>
- </tbody>
- </table>
- </span>
- </div>
- </div>
-
- <div id="#{clientId}_GridFooterTemplate"
class="ClientUI_InlineBox" style="width:
#{component.attributes['width']};">
- <div style="display: block; width: width: #{sumWidth}px;">
- <span class="ClientUI_TmplBox" id="FrozenBox">
- <table cellpadding="0" cellspacing="0">
- <tbody>
- <tr class="ClientUI_Grid_FR">
- <jsp:scriptlet>
- <![CDATA[
- renderFooters(context, component,true);
- ]]>
- </jsp:scriptlet>
- </tr>
- </tbody>
- </table>
- </span>
-
- <span class="ClientUI_TmplBox" id="NormalBox">
- <table cellpadding="0" cellspacing="0">
- <tbody>
- <tr class="ClientUI_Grid_FR">
- <jsp:scriptlet>
- <![CDATA[
- renderFooters(context, component,false);
- ]]>
- </jsp:scriptlet>
- </tr>
- </tbody>
- </table>
- </span>
- </div>
- </div>
-
- <input type="hidden" name="#{clientId}_state_input"
id="#{clientId}_state_input"/>
- <input type="hidden" name="#{clienId}_rows_input"
id="#{clientId}_rows_input" value="#{rows_count}"/>
- <input type="button" name="#{clientId}_submit_input"
id="#{clientId}_submit_input"
onclick="#{this:getRowsAjaxUpdate(context,component)}"
style="display:none"/>
-
- </div>
-
- <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',
- parent: ClientUI.controls.grid.DataModel
- }
- });
-
- Object.extend(ClientUI.controls.grid.FakeArrayDataModel.prototype, {
- 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 < 7; index2++) {
- this.data[index][index2] = index2 + " : " + index;
- }
- this.data[index][6] = index%2 ? "value 1" : "value 2";
- }
-
- return this.data[index];
- },
- getCount: function() {
- return this.count;
- },
- 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 id="#{clientId}_grid_create_scripts"
type="text/javascript">
- //<![CDATA[
-
-
- var #{this:getJavaScriptVarName(context, component)} = function() {
- return {
- init : function() {
- var currTime = (new Date()).getTime();
- // ClientUILib.log(ClientUILogger.WARNING, "Document loaded over " +
(currTime - ClientUILib.startTime) + " miliseconds.");
- var clientId = '#{clientId}';
- var rows_count = $(clientId + "_rows_input").value;
- var columns_count = '#{columns_count}';
-
- dataModel = new ClientUI.controls.grid.FakeArrayDataModel(rows_count,
columns_count, clientId);
-
- var templates = [
- {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.Grid(clientId +"_" +
'GridContainer', dataModel, templates,
- {
- showIndexColumn: false,
- indexColumnWidth: 40
- }
- );
- // ClientUILib.log(ClientUILogger.WARNING, "Grid control created over " +
((new Date()).getTime() - currTime) + " miliseconds.");
-
- grid.updateLayout();
-
- setTimeout(function() {
- currTime = (new Date()).getTime();
- //grid.loadData();
- }.bind(this), 100);
-
- // ClientUILib.log(ClientUILogger.WARNING, "Done.");
- }
-
- }
- }();
-
- #{this:getScriptContributions(context, component)};
- Event.observe(window, 'load', #{this:getJavaScriptVarName(context,
component)}.init);
-
-// ]]>
- </script>
-</f:root>
-
-
-
\ No newline at end of file