Author: abelevich
Date: 2007-05-18 06:21:31 -0400 (Fri, 18 May 2007)
New Revision: 801
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer2.java
Log:
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer2.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer2.java 2007-05-18
10:21:22 UTC (rev 800)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer2.java 2007-05-18
10:21:31 UTC (rev 801)
@@ -22,8 +22,10 @@
import org.richfaces.renderkit.CompositeRenderer;
import org.richfaces.utils.TemplateLoader;
+import com.sun.org.apache.bcel.internal.generic.NEW;
+
/**
* @author Anton Belevich
*
@@ -71,15 +73,15 @@
public void renderContent(FacesContext context, UIScrollableGridColumn column,
ResponseWriter writer, GridRendererState state) throws IOException {
- int index = state.getCellIndex();
- Integer cell_index = new Integer(index);
+
+ int cell_index = state.getCellIndex();
String client_id = state.getClientId();
- String cell_id = state.getColumnType()+ ":" + state.getRowIndex()+
":" + index;
+ String cell_id = state.getColumnType()+ ":" + state.getRowIndex()+
":" + cell_index;
headerCellTemplate = getHeaderCellTemplate();
ComponentVariables variables =
ComponentsVariableResolver.getVariables(headerCellTemplate, column);
variables.setVariable("cell_id",cell_id);
variables.setVariable("client_id", client_id);
- variables.setVariable("cell_index", cell_index);
+ variables.setVariable("cell_index", new Integer(cell_index));
headerCellTemplate.encodeBegin(context, column);
UIComponent component = column.getFacet(HEADER_PART);
@@ -95,13 +97,14 @@
public void renderContent(FacesContext context, UIScrollableGridColumn column,
ResponseWriter writer, GridRendererState state) throws IOException {
- String cell_id = state.getColumnType()+ ":" + state.getRowIndex()+
":" + state.getCellIndex();
+ int cell_index = state.getCellIndex();
+ String cell_id = state.getColumnType()+ ":" + state.getRowIndex()+
":" + cell_index;
String client_id = state.getClientId();
-
footerCellTemplate = getFooterCellTemplate();
ComponentVariables variables =
ComponentsVariableResolver.getVariables(footerCellTemplate, column);
variables.setVariable("cell_id",cell_id);
variables.setVariable("client_id", client_id);
+ variables.setVariable("cell_index", new Integer(cell_index));
footerCellTemplate.encodeBegin(context, column);
UIComponent component = column.getFacet(FOOTER_PART);
if(component != null){
@@ -116,13 +119,19 @@
public void renderContent(FacesContext context, UIScrollableGridColumn column,
ResponseWriter writer, GridRendererState state) throws IOException {
- String cell_id = state.getColumnType()+ ":" + state.getRowIndex()+
":" + state.getCellIndex();
+ int cell_index = state.getCellIndex();
+ String cell_id = state.getRowIndex()+ "_" + state.getCellIndex();
+ String column_type = state.getColumnType();
+ int row_index = state.getRowIndex();
String client_id = state.getClientId();
cellTemplate = getCellTemplate();
ComponentVariables variables = ComponentsVariableResolver.getVariables(cellTemplate,
column);
variables.setVariable("cell_id",cell_id);
+ variables.setVariable("row_index",new Integer(row_index));
+ variables.setVariable("column_type", column_type);
variables.setVariable("client_id", client_id);
+ variables.setVariable("cell_index",new Integer(cell_index));
cellTemplate.encodeBegin(context, column);
renderChildren(context, column);
cellTemplate.encodeEnd(context, column);
@@ -143,7 +152,7 @@
int index = ((Integer)rowIndex).intValue();
state.setRowIndex(index);
- String row_id = state.getClientId() + ":" + "row_" +
state.getColumnType() + ":" + index;
+ String row_id = "row_" + index;
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.TR_ELEMENT, grid);
state.setFrozenColumnCount(((Integer)grid.getAttributes().get("frozenColCount")).intValue());
@@ -163,10 +172,10 @@
if(state.isFrozenColumn()){
int i = state.getFrozenColumnCount();
state.setFrozenColumnCount(i-1);
- state.setCellIdPrefix(CELL_ID_PREFFIX + COLUMN_FROZEN_TYPE);
+ state.setCellIdPrefix(COLUMN_FROZEN_TYPE +":"+ CELL_ID_PREFFIX);
renderContent(context, column, writer,state);
}else{
- state.setCellIdPrefix(CELL_ID_PREFFIX + COLUMN_NORMAL_TYPE);
+ state.setCellIdPrefix(COLUMN_NORMAL_TYPE + ":" + CELL_ID_PREFFIX);
renderContent(context, column, writer,state);
}
return 1;
@@ -176,7 +185,7 @@
writer.startElement(HTML.SPAN_ELEM, column);
String columnWidth = (String)column.getAttributes().get("width");
- String cell_id = state.getClientId() + ":" + state.getCellIdPrefix() +
":" + state.getRowIndex()+":" + state.getCellIndex();
+ String cell_id = state.getClientId() + ":" + state.getCellIdPrefix() +
state.getRowIndex()+ "_" + state.getCellIndex();
getUtils().writeAttribute(writer, "id",cell_id);
getUtils().writeAttribute(writer, "class",
"ClientUI_Grid_BCBody");
getUtils().writeAttribute(writer, "style", "width:" +
columnWidth);