myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Stetsuk (JIRA)" <myfaces-...@incubator.apache.org>
Subject [jira] Commented: (MYFACES-586) NPE in UIData.restoreDescendantComponentStates()
Date Tue, 20 Sep 2005 12:58:29 GMT
    [ http://issues.apache.org/jira/browse/MYFACES-586?page=comments#action_12329990 ] 

Pavel Stetsuk commented on MYFACES-586:
---------------------------------------

    <h:dataTable id="grid"
                 value="#{nagrevBean.nagrevDTOs}" var="nagrevDTO"
                 binding="#{nagrevBean.data}"
                 border="1" cellspacing="0" width="100%"
                 styleClass="prn"
                 headerClass="head"
                 rowClasses="r_one,r_two"
                 >
      <h:column id="flagSaveColumn" rendered="#{!authenticationBean.guestAuthorized}">
        <f:facet name="header">
          <h:outputText id="flagSaveColumnHeader" value="+"  />
        </f:facet>
        <h:selectBooleanCheckbox id="flagSaveInput" value="#{nagrevDTO.flagSave}" rendered="#{nagrevDTO.canSave}"
/>
      </h:column>

      <h:column id="flagDeleteColumn" rendered="#{!authenticationBean.guestAuthorized}">
        <f:facet name="header">
          <h:outputText id="flagDeleteColumnHeader" value="-"  />
        </f:facet>
        <h:selectBooleanCheckbox id="flagDeleteInput" value="#{nagrevDTO.flagDelete}" rendered="#{nagrevDTO.canDelete}"
/>
      </h:column>

      <h:column id="nmkvColumn" rendered="#{nagrevBean.searchNmkv == null}">
        <f:facet name="header">
          <h:outputText id="nmkvColumnHeader" value="#{bundle.label_nmkv}"  />
        </f:facet>
        <h:outputText id="nmkvText" value="#{nagrevDTO.postMt.sl.nmkv}" />
      </h:column>

      <h:column id="nmpdColumn" rendered="#{nagrevBean.searchNmpd == null}">
        <f:facet name="header">
          <h:outputText id="nmpdColumnHeader" value="#{bundle.label_nmpd}"  />
        </f:facet>
        <h:outputText id="nmpdText" value="#{nagrevDTO.postMt.sl.nmpd}" />
      </h:column>

      <h:column id="nmslColumn">
        <f:facet name="header">
          <h:outputText id="nmslColumnHeader" value="№ слитка"  />
        </f:facet>
        <h:outputText id="nmslText" value="#{nagrevDTO.postMt.sl.nmsl}" />
      </h:column>

      <h:column id="tpslColumn">
        <f:facet name="header">
          <h:outputText id="tpslColumnHeader" value="Вид слитка"  />
        </f:facet>
        <h:outputText id="tpslText" value="#{nagrevDTO.postMt.sl.tpsl}" />
      </h:column>

      <h:column id="materialColumn">
        <f:facet name="header">
          <h:outputText id="materialColumnHeader" value="Материал"  />
        </f:facet>
        <h:outputText id="materialText"
                      value="#{nagrevDTO.accountSubject.r3Number}<br>#{nagrevDTO.accountSubject.description}"
                      escape="false"/>
      </h:column>

      <h:column id="mastColumn">
        <f:facet name="header">
          <h:outputText id="mastColumnHeader" value="Масса"/>
        </f:facet>
        <h:outputText id="mastText" value="#{nagrevDTO.postMt.sl.mast}">
          <f:convertNumber pattern="###0.000"/>
        </h:outputText>
      </h:column>

      <h:column id="tmpsColumn">
        <f:facet name="header">
          <h:outputText id="tmpsColumnHeader" value="t посада"  />
        </f:facet>
        <h:message id="tmpsError" for="tmpsInput" styleClass="form-error"/>
        <h:inputText id="tmpsInput" value="#{nagrevDTO.tmps}" binding="#{nagrevBean.tmpsInput}"
immediate="true"
                     rendered="#{nagrevBean.runType == 0 && nagrevDTO.canSave &&
!authenticationBean.guestAuthorized}"
                     onkeypress="onKeyPressEvent('form-edit:lastFocusHidden', this, 'int','center_detail');"
                     onchange="onChangeEvent('form-edit:lastFocusHidden', this,'center_detail');"
                     valueChangeListener="#{nagrevBean.tmpsChange}"
                     size="4" maxlength="4" styleClass="input_text"/>
        <h:outputText id="tmpsText" value="#{nagrevDTO.tmps}" rendered="#{!(nagrevBean.runType
== 0 && nagrevDTO.canSave) && nagrevDTO.nmpp != null}"/>
      </h:column>

      <h:column id="nmgkColumn">
        <f:facet name="header">
          <h:outputText id="nmgkColumnHeader" value="№ группы"  />
        </f:facet>
        <h:message id="nmgkError" for="nmgkInput" styleClass="form-error"/>
        <h:inputText id="nmgkInput" value="#{nagrevDTO.nmgk}" binding="#{nagrevBean.nmgkInput}"
immediate="true"
                     rendered="#{nagrevBean.runType == 0 && nagrevDTO.canSave &&
!authenticationBean.guestAuthorized}"
                     onkeypress="onKeyPressEvent('form-edit:lastFocusHidden', this, 'int','center_detail');
"
                     onchange="onChangeEvent('form-edit:lastFocusHidden', this,'center_detail');"
                     valueChangeListener="#{nagrevBean.nmgkChange}"
                     size="2" maxlength="2" styleClass="input_text"/>
        <h:outputText id="nmgkText" value="#{nagrevDTO.nmgk}" rendered="#{!(nagrevBean.runType
== 0 && nagrevDTO.canSave) && nagrevDTO.nmpp != null}"/>
      </h:column>

      <h:column id="nmklColumn">
        <f:facet name="header">
          <h:outputText id="nmklColumnHeader" value="№ колодца"  />
        </f:facet>
        <h:message id="nmklError" for="nmklInput" styleClass="form-error"/>
        <h:inputText id="nmklInput" value="#{nagrevDTO.nmkl}" binding="#{nagrevBean.nmklInput}"
immediate="true"
                     rendered="#{nagrevBean.runType == 0 && nagrevDTO.canSave &&
!authenticationBean.guestAuthorized}"
                     onkeypress="onKeyPressEvent('form-edit:lastFocusHidden', this, 'int','center_detail');
"
                     onchange="onChangeEvent('form-edit:lastFocusHidden', this,'center_detail');"
                     valueChangeListener="#{nagrevBean.nmklChange}"
                     size="2" maxlength="2" styleClass="input_text"/>
        <h:outputText id="nmklText" value="#{nagrevDTO.nmkl}" rendered="#{!(nagrevBean.runType
== 0 && nagrevDTO.canSave) && nagrevDTO.nmpp != null}"/>
      </h:column>

      <h:column id="nmppColumn">
        <f:facet name="header">
          <h:outputText id="nmppColumnHeader" value="Схема посадки"  />
        </f:facet>
        <h:message id="nmppError" for="nmppInput" styleClass="out_error"/>
        <h:inputText id="nmppInput" value="#{nagrevDTO.nmpp}" binding="#{nagrevBean.nmppInput}"
immediate="true"
                     rendered="#{nagrevBean.runType == 0 && nagrevDTO.canSave &&
!authenticationBean.guestAuthorized}"
                     onkeypress="onKeyPressEvent('form-edit:lastFocusHidden', this, 'int','center_detail');
"
                     onchange="onChangeEvent('form-edit:lastFocusHidden', this,'center_detail');"
                     valueChangeListener="#{nagrevBean.nmppChange}"
                     size="2" maxlength="2" styleClass="input_text"/>
        <h:outputText id="nmppText" value="#{nagrevDTO.nmpp}" rendered="#{!(nagrevBean.runType
== 0 && nagrevDTO.canSave)}"/>
      </h:column>

      <h:column id="dtpsColumn">
        <f:facet name="header">
          <h:outputText id="dtpsColumnHeader" value="Время посада"  />
        </f:facet>
        <h:message id="dtpsError" for="dtpsInput" styleClass="out_error"/>
        <h:inputText id="dtpsInput" value="#{nagrevDTO.dtps}" binding="#{nagrevBean.dtpsInput}"
immediate="true"
                     rendered="#{nagrevBean.runType == 0 && nagrevDTO.canSave &&
!authenticationBean.guestAuthorized}"
                     onkeypress="onKeyPressEvent('form-edit:lastFocusHidden', this, 'date','center_detail');"
                     onchange="onChangeEvent('form-edit:lastFocusHidden', this,'center_detail');"
                     valueChangeListener="#{nagrevBean.dtpsChange}"
                     size="5" maxlength="5" styleClass="input_text">
          <f:converter converterId="com.azovstal.asctp.obg.web.converter.ShortDateConverter"/>
        </h:inputText>
        <h:outputText id="dtpsText" value="#{nagrevDTO.dtps}" rendered="#{!(nagrevBean.runType
== 0 && nagrevDTO.canSave) && nagrevDTO.nmpp != null}">
          <f:convertDateTime pattern="HH:mm dd.MM.yyyy"/>
        </h:outputText>
      </h:column>

      <h:column id="dtnnColumn">
        <f:facet name="header">
          <h:outputText id="dtnnColumnHeader" value="Время начала нагрева"
 />
        </f:facet>
        <h:message id="dtnnError" for="dtnnInput" styleClass="out_error"/>
        <h:inputText id="dtnnInput" value="#{nagrevDTO.dtnn}" binding="#{nagrevBean.dtnnInput}"
immediate="true"
                     rendered="#{nagrevBean.runType == 2 && nagrevDTO.canSave &&
!authenticationBean.guestAuthorized}"
                     onkeypress="onKeyPressEvent('form-edit:lastFocusHidden', this, 'date','center_detail');
"
                     onchange="onChangeEvent('form-edit:lastFocusHidden', this,'center_detail');"
                     valueChangeListener="#{nagrevBean.dtnnChange}"
                     size="5" maxlength="5" styleClass="input_text">
          <f:converter converterId="com.azovstal.asctp.obg.web.converter.ShortDateConverter"/>
        </h:inputText>
        <h:outputText id="dtnnText" value="#{nagrevDTO.dtnn}" rendered="#{!(nagrevBean.runType
== 2 && nagrevDTO.canSave)}">
          <f:convertDateTime pattern="HH:mm dd.MM.yyyy"/>
        </h:outputText>
      </h:column>

      <h:column id="dtvdColumn">
        <f:facet name="header">
          <h:outputText id="dtvdColumnHeader" value="Время выдачи"  />
        </f:facet>
        <h:message id="dtvdError" for="dtvdInput" styleClass="out_error"/>
        <h:inputText id="dtvdInput" value="#{nagrevDTO.dtvd}" binding="#{nagrevBean.dtvdInput}"
immediate="true"
                     rendered="#{nagrevBean.runType == 1 && nagrevDTO.canSave &&
!authenticationBean.guestAuthorized}"
                     onkeypress="onKeyPressEvent('form-edit:lastFocusHidden', this, 'date','center_detail');
"
                     onchange="onChangeEvent('form-edit:lastFocusHidden', this,'center_detail');"
                     valueChangeListener="#{nagrevBean.dtvdChange}"
                     size="5" maxlength="5" styleClass="input_text">
          <f:converter converterId="com.azovstal.asctp.obg.web.converter.ShortDateConverter"/>
        </h:inputText>
        <h:outputText id="dtvdText" value="#{nagrevDTO.dtvd}" rendered="#{!(nagrevBean.runType
== 1 && nagrevDTO.canSave)}">
          <f:convertDateTime pattern="HH:mm dd.MM.yyyy"/>
        </h:outputText>
      </h:column>

    </h:dataTable>


> NPE in UIData.restoreDescendantComponentStates()
> ------------------------------------------------
>
>          Key: MYFACES-586
>          URL: http://issues.apache.org/jira/browse/MYFACES-586
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Versions: 1.1.0
>  Environment: w2k, jboss-4.0.2, tomcat55
>     Reporter: Pavel Stetsuk
>     Assignee: Mathias Broekelmann

>
> Error like MYFACES-520
> I have JSP like:
> <f:view>
> ...
>   <h:form id="form-edit">
>   ...
>     <h:dataTable id="grid"
>                  value="#{nagrevBean.nagrevDTOs}" var="nagrevDTO"
>                  >
>       <h:column id="flagSaveColumn" rendered="#{!authenticationBean.guestAuthorized}">
>         <f:facet name="header">
>           <h:outputText id="flagSaveColumnHeader" value="+"  />
>         </f:facet>
>         <h:selectBooleanCheckbox id="flagSaveInput" value="#{nagrevDTO.flagSave}"
rendered="#{nagrevDTO.canSave}" />
>       </h:column>
>       ....
>     </h:dataTable>
>   </h:form>
> </f:view>
> When a value is entered in the required inputText field, the form submits successfully.
But in RENDER_RESPONSE phase i have error
> java.lang.NullPointerException
> 	at javax.faces.component.UIData.restoreDescendantComponentStates(UIData.java:223)
> 	at javax.faces.component.UIData.restoreDescendantComponentStates(UIData.java:235)
> 	at javax.faces.component.UIData.setRowIndex(UIData.java:186)
> 	at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:135)
> 	at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:94)
> 	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:319)
> 	at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:343)
> 	at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:251)
> 	at org.apache.myfaces.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:55)
> 	at org.apache.jsp.nagrev_jsp._jspx_meth_h_dataTable_0(org.apache.jsp.nagrev_jsp:1672)
> 	at org.apache.jsp.nagrev_jsp._jspService(org.apache.jsp.nagrev_jsp:286)
> 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> 	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
> 	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
> 	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
> 	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
> 	at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
> 	at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
> 	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> 	at com.azovstal.asctp.web.HibernateFilter.doFilter(HibernateFilter.java:35)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> 	at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> 	at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
> 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
> 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
> 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
> 	at java.lang.Thread.run(Thread.java:595)
> ...
> javax.faces.FacesException: org.apache.jasper.JasperException
> 	at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:425)
> 	at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
> 	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
> ...
> Function 
>     private void restoreDescendantComponentStates(Iterator childIterator,
>             Object state, boolean restoreChildFacets)
> calling with state == null
> The following change to UIData seems to fix the problem: 
> ... 
>             if (descendantStateIterator != null 
>                     && descendantStateIterator.hasNext()) 
>             { 
>              System.out.println("has dsi"); 
>                 Object[] object = (Object[]) descendantStateIterator.next(); 
>                 childState = object[0]; 
>                 descendantState = object[1]; 
>                 if (component instanceof EditableValueHolder) 
>                 { 
>                     ((EditableValueHolderState) childState) 
>                             .restoreState((EditableValueHolder) component); 
>                 } 
>             } 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message