14 Replies Latest reply on Jan 29, 2009 5:31 AM by Nick Belaevski

    richfaces 3.3 .. did not find parent form

    nimo stephan Master

      After upgrading from 3.2 to 3.3,
      all my rich:dataTables needs to be surrounded by a h:form-tag.
      (That was not the case in 3.2.)

      class org.richfaces.component.html.HtmlDataTable (id="myDataTable") did not find parent form.


      So I changed it to:
      <h:form>
      <rich:dataTable..
      </rich:dataTable>
      </h:form>



        • 1. Re: richfaces 3.3 .. did not find parent form
          Ilya Shaikovsky Master

          Should not be so. seems you using some command* components or supports inside the table. Or turn filtering/sorting on.

          In all this cases - form should presents on the page in order to send requests.

          • 2. Re: richfaces 3.3 .. did not find parent form
            nimo stephan Master

            Yes, I use <rich:column filterBy...
            and have some a4j:commandLink inside a column. However, filterBy does not need to have a form in richfaces 3.2.

            In RichFaces 3.2, I have sourrounded only the commandLinks with a form such as:

            This workes with RichFaces 3.2, but not with 3.3:

            <h:dataTable...>
            <h:column>
            ...
            </h:column>
            ...
            <h:form>
            <h:column>
            <a4j:commandLink>
            ..
            </a4j:commandLink>
            </h:column>
            </h:form>
            <h:dataTable>




            • 3. Re: richfaces 3.3 .. did not find parent form
              nimo stephan Master

              The main problem is now, that I get a NullPointerException,
              thought I have no form-tags within other forms:

              Error Rendering View[/myView.xhtml]
              java.lang.NullPointerException
               at org.jboss.seam.jsf.SeamApplication$ConverterLocator.locateConverter(SeamApplication.java:166)
               at org.jboss.seam.jsf.SeamApplication$ConverterLocator.getConverter(SeamApplication.java:148)
               at org.jboss.seam.jsf.SeamApplication.createConverter(SeamApplication.java:122)
               at org.richfaces.component.UIOrderingBaseComponent.getConverterForType(UIOrderingBaseComponent.java:534)
               at org.richfaces.component.UIOrderingBaseComponent.getConverterForValue(UIOrderingBaseComponent.java:559)
               at org.richfaces.renderkit.OrderingComponentRendererBase.getConverter(OrderingComponentRendererBase.java:574)
               at org.richfaces.renderkit.ListShuttleRendererBase.encodeRows(ListShuttleRendererBase.java:116)
               at org.richfaces.renderkit.html.ListShuttleRenderer.doEncodeChildren(ListShuttleRenderer.java:267)
               at org.richfaces.renderkit.html.ListShuttleRenderer.doEncodeChildren(ListShuttleRenderer.java:257)
               at org.richfaces.renderkit.ListShuttleRendererBase.encodeChildren(ListShuttleRendererBase.java:244)
               at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
               at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:291)
               at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:321)
               at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelCaptionGroupRenderer.encodeAll(PanelCaptionGroupRenderer.java:98)
               at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:224)
               at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:749)
               at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:279)
               at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:242)
               at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
               at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:291)
               at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelGroupLayoutRenderer.encodeChild(PanelGroupLayoutRenderer.java:188)
               at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelGroupLayoutRenderer._encodeChildren(PanelGroupLayoutRenderer.java:154)
               at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:106)
               at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:224)
               at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:749)
               at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:304)
               at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:321)
               at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelCaptionGroupRenderer.encodeAll(PanelCaptionGroupRenderer.java:98)
               at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:224)
               at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:749)
               at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
               at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
               at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:78)
               at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
               at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
               at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
               at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
               at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
               at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
               at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:124)
               at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
               at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
               at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
               at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
               at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
               at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
               at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
               at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
               at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
               at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:677)
               at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:548)
               at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
               at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
               at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:178)
               at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:188)
               at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
               at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
               at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
               at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
               at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
               at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
               at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
               at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
               at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:73)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
               at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
               at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
               at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
               at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
               at java.lang.Thread.run(Unknown Source)


              any advise?



              • 4. Re: richfaces 3.3 .. did not find parent form
                Ilya Shaikovsky Master

                I can't believe in this. This could be affected from trinidad probably. But commandLink always submits its form from the times when it was implemented. ;)

                • 5. Re: richfaces 3.3 .. did not find parent form
                  nimo stephan Master

                  This works with Richfaces 3.2, but not with 3.3:

                  <h:dataTable...>
                  <h:column>
                  ...
                  </h:column>
                  ...
                  
                  <h:column>
                  
                  <h:form>
                  <a4j:commandLink>
                  ..
                  </a4j:commandLink>
                  </h:form>
                  </h:column>
                  
                  <h:dataTable>


                  When I upgraded to richfaces 3.3, I get this failure:

                  class org.richfaces.component.html.HtmlDataTable (id="myDataTable") did not find parent form.


                  and changed ONLY ONE thing: I wrapped my whole dataTable with a form and deleted the form-tags within the dataTable:

                  <h:form>
                  <h:dataTable...>
                  <h:column>
                  ...
                  </h:column>
                  ...
                  
                  <h:column>
                  
                  
                  <a4j:commandLink>
                  ..
                  </a4j:commandLink>
                  </h:column>
                  <h:dataTable>
                  </h:form>


                  and then the "null pointer exception" occurs. I swear:-)
                  I know, in trinidad this failure only occurs when forms are nested,
                  but I have no nested forms.

                  • 6. Re: richfaces 3.3 .. did not find parent form
                    Ilya Shaikovsky Master

                    Sorry We've found the place in dataTable code where we checking for the form(if filtering used). But in any way this check should be done in this case and links can't work without the form.. So seems very strange form me.

                    And about your code - just add the form - this is right action for sure.

                    • 7. Re: richfaces 3.3 .. did not find parent form
                      nimo stephan Master

                      thank you ilya,

                      I found the failure and it s very strange for me as it worked with 3.2.

                      it s the rich:listShuttle which is in same view as the dataTable.
                      I have thought, that the datatable was the problem as the nullpointer exception does not tell me more..).

                      It seems that the source/target-value for a rich:listShuttle does not work anymore when having common strings. I have 5 rich:listShuttles in the same view and only one listShuttle is the reason for the nullpointer-exception (I have other listShuttles which works well in the view having values from entities). When I delete this listShuttle, all works in Richfaces 3.3 (this listShuttle definitly workes in richFaces 3.2)

                      This listShuttle has common string-values:

                      <rich:listShuttle sourceValue="#{myStrings['list1']}" targetValue="#{myStrings['list2']}" var="_l" >
                      <rich:column>
                      <h:outputLabel value="#{_l}" />
                      </rich:column>
                      </rich:listShuttle>


                      List<String> myList1= new ArrayList<String>();
                      myList1.add("test1");
                      myList1.add("test2");
                      myStrings = new HashMap<String, List<String>>();
                      findUsersByLanguages.put("list1", myList1);
                      
                      List<String> myList2= new ArrayList<String>();
                      myList2.add("test3");
                      myList2.add("test4");
                      myStrings = new HashMap<String, List<String>>();
                      findUsersByLanguages.put("list2", myList2);


                      The map and its values are definitly available as when I do this, my Map is shown:
                      <h:outputText value="#{findUsersByLanguages['list1']}"/>
                      <h:outputText value="#{findUsersByLanguages['list2']}"/>


                      Has anything changed in rich:listShuttle?

                      • 8. Re: richfaces 3.3 .. did not find parent form
                        nimo stephan Master

                        The map and its values are definitly available as when I do this, my Map is shown:

                        <h:outputText value="#{myStrings['list1']}"/>
                        <h:outputText value="#{myStrings['list2']}"/>

                        • 9. Re: richfaces 3.3 .. did not find parent form
                          nimo stephan Master

                          sorry, I have copied the false code for my listShuttle's Map:

                          List<String> myList1= new ArrayList<String>();
                          myList1.add("test1");
                          myList1.add("test2");
                          
                          List<String> myList2= new ArrayList<String>();
                          myList2.add("test3");
                          myList2.add("test4");
                          
                          myStrings = new HashMap<String, List<String>>();
                          myStrings .put("list1", myList1);
                          myStrings .put("list2", myList2);


                          In the same view, the map and its values are shown:
                          <h:outputText value="#{myStrings['list1']}"/>
                          <h:outputText value="#{myStrings['list2']}"/>



                          • 11. Re: richfaces 3.3 .. did not find parent form
                            nimo stephan Master

                            thanks,

                            I have been searching for the real reason without success.

                            I guess, the update to SEAM 2.1.1 causes the NPE in RichFaces.
                            Using Seam 2.1.0 and RichFaces 3.3.3 works well.

                            NPE such as the following occurs after submitting a form:

                            Caused by: java.lang.NullPointerException
                             at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormRenderer.encodeEnd(FormRenderer.java:210)
                             at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:228)
                             at org.apache.myfaces.trinidadinternal.renderkit.htmlBasic.HtmlFormRenderer.encodeEnd(HtmlFormRenderer.java:63)
                             at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
                             at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:304)
                             at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:321)
                             at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelCaptionGroupRenderer.encodeAll(PanelCaptionGroupRenderer.java:98)
                             at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:224)
                             at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:763)
                             at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
                             at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
                             at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:78)
                             at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
                             at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:124)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                             at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                             at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
                             at org.ajax4jsf.component.UIAjaxRegion.encodeAjax(UIAjaxRegion.java:267)
                             at org.ajax4jsf.component.AjaxViewRoot$4.invokeContextCallback(AjaxViewRoot.java:489)
                             at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:24)
                             at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:672)
                             ... 64 more


                            I have downgraded to Seam 2.1.0 with RichFaces 3.3.3 and all works.

                            bye

                            • 12. Re: richfaces 3.3 .. did not find parent form
                              nimo stephan Master

                              Hello,

                              I have put Code into the Issue https://jira.jboss.org/jira/browse/RF-5772 to reproduce the NPE.

                              greetings

                              • 13. Re: richfaces 3.3 .. did not find parent form
                                Ilya Shaikovsky Master

                                Thanks for your inputs!

                                • 14. Re: richfaces 3.3 .. did not find parent form
                                  Nick Belaevski Master

                                  Hi,

                                  I've added comment to JIRA issue.