1 Reply Latest reply on Dec 22, 2008 9:45 AM by Gregor Jarisch

    NullPointerException after submitting modalpanel form

    Gregor Jarisch Newbie

      hi,

      i am currently facing an strange component behavior and was wondering if somebody can help me out.

      i have a modalpanel which gets called from within a form to change some values. After submitting of the form in the modalpanel the main table should rerender and show the changed results.

      So one component in a form should force another component to rerender in a different form.

      Everything works fine except of the rerendering at the end of the process (id="showOrders").

      the exception is:

      java.lang.NullPointerException
       org.richfaces.component.ColumnsSizeState.getColumnSize(ExtendedDataTableState.java:299)
       org.richfaces.component.ExtendedDataTableState.getColumnSize(ExtendedDataTableState.java:159)
       org.richfaces.component.UIExtendedDataTable.getColumnSize(UIExtendedDataTable.java:183)
       org.richfaces.renderkit.AbstractExtendedTableRenderer.encodeColumns(AbstractExtendedTableRenderer.java:130)
       org.richfaces.renderkit.html.ExtendedDataTableRenderer.doEncodeBegin(ExtendedDataTableRenderer.java:301)
       org.richfaces.renderkit.html.ExtendedDataTableRenderer.doEncodeBegin(ExtendedDataTableRenderer.java:236)
       org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:101)
       org.richfaces.renderkit.AbstractExtendedTableRenderer.encodeBegin(AbstractExtendedTableRenderer.java:1346)
       javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
       javax.faces.component.UIData.encodeBegin(UIData.java:962)
       org.ajax4jsf.component.UIDataAdaptor.encodeBegin(UIDataAdaptor.java:1220)
       com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:232)
       com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:180)
       com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:127)
       javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
       org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
       org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:124)
       org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
       org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
       org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
       org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
       org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
       org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
       org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
       org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:677)
       org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:548)
       javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
       com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266)
       com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197)
       org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
       org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:197)
       com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
       com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:307)
       org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:423)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:550)


      the code:
      <rich:modalPanel id="editPanel" width="600" height="500">
       <a4j:keepAlive beanName="Order" />
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText id="modalTitle" value="#{Panel.title}" escape="false" />
       </h:panelGroup>
       </f:facet>
       <h:form>
       <a4j:include ajaxRendered="false" viewId="#{Panel.path}" />
      
       <h:panelGrid columns="3">
       <a4j:commandButton id="save"
       value="Speichern"
      
      
       actionListener="#{Order.submitOrder}"
       oncomplete="Richfaces.hideModalPanel('editPanel')"
      reRender="showOrders" />
       <a4j:commandButton id="cancel"
       value="Abbrechen"
       onclick="Richfaces.hideModalPanel('editPanel')" />
       </h:panelGrid>
       </h:form>
      </rich:modalPanel>
      
      <a4j:jsFunction name="refreshViewPanel" actionListener="#{Order.loadSelectedOrder}" reRender="viewPanel" />
      <h:panelGrid id="showOrders" columns="2">
       <a4j:keepAlive beanName="Panel" ajaxOnly="true" />
       <rich:extendedDataTable id="chosenItems"
       value="#{Order.orders}" var="item"
       width="500px" height="250px"
       selectionMode="single"
       sortMode="multi"
       selection="#{Order.selectedRows}"
       binding="#{Order.openOrderTable}"
       onRowDblClick="refreshViewPanel()">
       <rich:column sortable="true" width="150px" filterBy="#{item.company.company}" filterEvent="onblur">
       <f:facet name="header">
       <h:outputText value="Firma"/>
       </f:facet>
       <h:outputText value="#{item.company.company}"/>
       </rich:column>
       <rich:column sortable="true" width="150px" filterBy="#{item.person.fullname}" filterEvent="onblur">
       <f:facet name="header">
       <h:outputText value="Kontaktperson"/>
       </f:facet>
       <h:outputText value="#{item.person.fullname}"/>
       </rich:column>
       <rich:column sortable="true" width="100px" filterBy="#{item.order.startdate}" filterEvent="onblur">
       <f:facet name="header">
       <h:outputText value="Auftragsstart"/>
       </f:facet>
       <h:outputText value="#{item.order.startdate}"/>
       </rich:column>
       <rich:column sortable="true" width="100px" filterBy="#{item.order.enddate}" filterEvent="onblur">
       <f:facet name="header">
       <h:outputText value="Auftragsende"/>
       </f:facet>
       <h:outputText value="#{item.order.enddate}"/>
       </rich:column>
       </rich:extendedDataTable>
      ...
      <h:panelGrid id="showOrders" columns="2">
      


      Thanks in advance.