Author: maksimkaszynski
Date: 2007-08-02 12:33:17 -0400 (Thu, 02 Aug 2007)
New Revision: 2023
Modified:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
Log:
now cell styles are updated correctly
Modified:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
---
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-08-02
16:32:19 UTC (rev 2022)
+++
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-08-02
16:33:17 UTC (rev 2023)
@@ -250,42 +250,6 @@
};
- private final ColumnVisitor ajaxCellRenderer = new ExtendedColumnVisitor(){
-
- public void renderContent(FacesContext context, UIScrollableGridColumn column,
ResponseWriter writer, GridRendererState state) throws IOException {
- String cell_id = state.getRowIndex()+ "_" + state.getCellIndex();
-
- if (log.isTraceEnabled()) {
- log.trace("cell_index: " + cell_id);
- }
-
- String client_id = state.getClientId();
- int cell_index = state.getCellIndex();
-
-// ComponentVariables variables = ComponentsVariableResolver.getVariables(cellTemplate,
column);
-// variables.setVariable("cell_id",cell_id);
-// variables.setVariable("client_id", client_id);
-// variables.setVariable("cell_index", new Integer(cell_index));
-// variables.setVariable("columnClass", state.getColumnClass(cell_index));
-
- UIScrollableGrid grid = state.getGrid();
- writer.startElement("td", grid);
- writer.startElement("div", grid);
- getUtils().writeAttribute(writer, "class", "dr-sgrid-bcbody1");
- writer.startElement("div", grid);
- getUtils().writeAttribute(writer, "class", "dr-sgrid-bcbody");
- String divId = client_id + ":bc_" + cell_id;
- getUtils().writeAttribute(writer, "id", divId);
- if(!state.isFake()) {
- renderChildren(context, column);
- }
- writer.endElement("div");
- writer.endElement("div");
- writer.endElement("td");
-
- }
- };
-
private final DataVisitor rowsRenderer = new DataVisitor(){
public void process(FacesContext context, Object rowKey, Object argument) throws
IOException {
@@ -398,7 +362,7 @@
}
UIScrollableGridColumn column = (UIScrollableGridColumn)kid;
- columnsCount += ajaxCellRenderer.visit(context, column, writer, state);
+ columnsCount += cellRenderer.visit(context, column, writer, state);
// columnsCount += cellRenderer.visit(context, column, writer, state);
state.nextCell();
@@ -775,12 +739,12 @@
private boolean onlyPartialUpdateNeeded(UIComponent grid) {
Boolean b = (Boolean) grid.getAttributes().get(PARTIAL_UPDATE);
- return b != null && b.booleanValue();
+ return b != null && b.booleanValue() &&
AjaxContext.getCurrentInstance().isAjaxRequest();
}
private boolean shouldUpdateHeader(UIComponent grid) {
- Boolean b = (Boolean) grid.getAttributes().get(PARTIAL_UPDATE);
- return b != null && b.booleanValue();
+ Boolean b = (Boolean) grid.getAttributes().get(UPDATE_HEADER);
+ return b != null && b.booleanValue() &&
AjaxContext.getCurrentInstance().isAjaxRequest();
}
public void encodeChildren(FacesContext context, UIComponent component
Show replies by date