Index: webui/src/designtime/com/sun/webui/jsf/component/TableRowGroupDesignInfo.java =================================================================== RCS file: /cvs/woodstock/webui/src/designtime/com/sun/webui/jsf/component/TableRowGroupDesignInfo.java,v retrieving revision 1.4 diff -u -r1.4 TableRowGroupDesignInfo.java --- webui/src/designtime/com/sun/webui/jsf/component/TableRowGroupDesignInfo.java 16 Aug 2007 00:06:20 -0000 1.4 +++ webui/src/designtime/com/sun/webui/jsf/component/TableRowGroupDesignInfo.java 25 Aug 2007 01:37:39 -0000 @@ -29,7 +29,6 @@ import com.sun.rave.designtime.DesignProperty; import com.sun.rave.designtime.DisplayAction; import com.sun.rave.designtime.Result; -import com.sun.rave.designtime.event.DesignBeanListener; import com.sun.rave.designtime.faces.FacesDesignContext; import com.sun.webui.jsf.component.customizers.TableBindToDataAction; import com.sun.webui.jsf.component.customizers.TableCustomizerAction; @@ -37,7 +36,11 @@ import com.sun.webui.jsf.design.AbstractDesignInfo; import com.sun.webui.jsf.component.table.TableRowGroupDesignState; import com.sun.webui.jsf.component.TableRowGroup; +import javax.faces.component.UIComponent; import javax.faces.el.ValueBinding; +import javax.el.ValueExpression; +import javax.el.ELContext; +import javax.el.ELException; import javax.faces.context.FacesContext; import com.sun.data.provider.DataAdapter; import com.sun.data.provider.DataListener; @@ -312,7 +315,46 @@ public void providerChanged(DataProvider provider) { DesignContext dcontext = tableRowGroupBean.getDesignContext(); DesignBean dataProviderBean = dcontext.getBeanForInstance(provider); + boolean reconstruct = false; if (dataProviderBean != null) { + //go through the columns of the row group + DesignBean[] children = tableRowGroupBean.getChildBeans(); + if (children != null && children.length > 0) { + childrenLoop: + for (int c = 0; c < children.length; c++) { + DesignBean child = children[c]; + if (child.getInstance() instanceof TableColumn) { + //this is a TableColumn. loop through its children (grandchildren of the row group) + DesignBean[] grandchildren = child.getChildBeans(); + if (grandchildren != null && grandchildren.length > 0) { + for (int g = 0; g < grandchildren.length; g++) { + DesignBean grandchild = grandchildren[g]; + //try to evaluate the binding for the "value" property of the grandchild + //if evaluating it throws an ELException, then we need to reconstruct the table columns + Object instanceObject = grandchild.getInstance(); + if (instanceObject instanceof UIComponent) { + UIComponent grandchildInstance = (UIComponent)instanceObject; + ValueExpression ve = grandchildInstance.getValueExpression("value"); //NOI18N + if (ve != null) { + FacesDesignContext fdcontext = (FacesDesignContext)tableRowGroupBean.getDesignContext(); + FacesContext fcontext = fdcontext.getFacesContext(); + ELContext elcontext = fcontext.getELContext(); + try { + ve.getValue(elcontext); + } + catch (ELException e) { + reconstruct = true; + break childrenLoop; + } + } + } + } + } + } + } + } + } + if (reconstruct) { TableRowGroupDesignState tblRowGroupDesignState = new TableRowGroupDesignState(tableRowGroupBean); tblRowGroupDesignState.setDataProviderBean(dataProviderBean,true); tblRowGroupDesignState.saveState();