0 Replies Latest reply on Jun 3, 2011 10:48 AM by Carlos Zuluaga

    HtmlDatascroller Problem  in custom jsf tag

    Carlos Zuluaga Newbie

      Heay Guys i hope u can help with this error.

       

      Im developing a custom jsf tag that use a HtmlDataTable and HtmlDatascroller, the problem i have is whean i add the datascroller y get the follow error.

       

      Here is My Code

       

      public void encodeBegin(FacesContext context, UIComponent component) throws IOException {

             

              HtmlLigthBox ligthBox = (HtmlLigthBox)component;

             

             

              modalPanel = new HtmlPanelGroup();

             

              dataTable = new HtmlDataTable();

              dataTable.setVar("iter");

              dataTable.setRows(Integer.parseInt(ligthBox.getRows()));

              dataTable.setValue(ligthBox.getItems());

             

             

              HtmlColumn column = new HtmlColumn();

              HtmlOutputText output = new HtmlOutputText();

             

              ValueExpression ve = FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createValueExpression(FacesContext.getCurrentInstance().getELContext(), "#{iter.description}", Object.class);

              output.setValueExpression("value",  ve);

             

              column.getChildren().add(output);

              dataTable.getChildren().add(column);

             

              scroller = new HtmlDatascroller();

              scroller.setFor(dataTable.getId());

                     

              modalPanel.getChildren().add(dataTable);

              modalPanel.getChildren().add(scroller);

              this.encodeChildren(FacesContext.getCurrentInstance(), modalPanel);

       

          }

       

       

       

      javax.servlet.ServletException: class org.richfaces.component.html.HtmlDatascroller (id="j_id3") did not find parent form.

      javax.faces.webapp.FacesServlet.service(FacesServlet.java:321)

      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)

      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

      causa raíz

      org.richfaces.component.EnclosingFormRequiredException: class org.richfaces.component.html.HtmlDatascroller (id="j_id3") did not find parent form.
           org.richfaces.component.util.FormUtil.throwEnclFormReqExceptionIfNeed(FormUtil.java:45)
           org.richfaces.renderkit.html.DatascrollerTemplate.doEncodeEnd(DatascrollerTemplate.java:175)
           org.richfaces.renderkit.html.DatascrollerTemplate.doEncodeEnd(DatascrollerTemplate.java:662)
           org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:134)
           javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:879)
           javax.faces.component.UIComponent.encodeAll(UIComponent.java:1650)
           javax.faces.render.Renderer.encodeChildren(Renderer.java:164)
           co.com.helmbank.view.model.LigthBoxRender.encodeBegin(LigthBoxRender.java:51)
           javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:824)
           org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:275)
           org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)
           org.richfaces.renderkit.html.ModalPanelRenderer.doEncodeChildren(ModalPanelRenderer.java:368)
           org.richfaces.renderkit.html.ModalPanelRenderer.doEncodeChildren(ModalPanelRenderer.java:363)
           org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
           javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
           com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:300)
           com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:181)
           com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:125)
           javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
           com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:300)
           com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:181)
           com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:125)
           javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
           com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:300)
           com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:101)
           javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
           com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:300)
           com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:181)
           com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:125)
           javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
           com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:300)
           com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:181)
           com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:125)
           javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
           javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643)
           javax.faces.render.Renderer.encodeChildren(Renderer.java:164)
           javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
           javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643)
           javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646)
           com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:427)
           com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:229)
           com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
           org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
           org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
           com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117)
           com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
           com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
           javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)
           org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
           org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
           org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)