1 2 Previous Next 16 Replies Latest reply on Sep 6, 2007 2:10 PM by Mike Sauer

    reRender problem

    Mike Sauer Newbie

      I am trying to use Ajax4Jsf with Trinidad, Facelets, and JSF 1.2. I am running into a number of problems.
      I have a required text field, a check box and a set of fields that are enabled if the checkbox is selected. I am trying to use ajax on the checkbox and only refresh the fields that are associated with it.
      First thing I noticed is that if I have prependId=false on my form, the ajaxSingle=true setting does seem to work. I get a validation error saying the required field is not populated. If I take the prependId setting out, the validator on the text field is not processed but I run into other problems.
      If the initial state of the page is that the box is not selected and the fields are disabled, selecting the checkbox results in the following:

      Jun 28, 2007 8:17:57 AM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/ajax_test.xhtml]
      java.lang.NullPointerException
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.EditableValueRenderer.addOnSubmitConverterValidators(EditableValueRenderer.java:206)
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputTextRenderer.encodeAllAsElement(SimpleInputTextRenderer.java:105)
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputListOfValuesRenderer.renderTextField(SimpleInputListOfValuesRenderer.java:197)
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputListOfValuesRenderer.encodeAllAsElement(SimpleInputListOfValuesRenderer.java:154)
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputDateRenderer.encodeAllAsElement(SimpleInputDateRenderer.java:194)
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormElementRenderer.encodeAll(FormElementRenderer.java:109)
       at org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:315)
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.renderFieldCellContents(InputLabelAndMessageRenderer.java:142)
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer._renderFieldCell(LabelAndMessageRenderer.java:375)
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer.encodeAll(LabelAndMessageRenderer.java:270)
       at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.encodeAll(InputLabelAndMessageRenderer.java:120)
       at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:205)
       at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:733)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
       at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:282)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:159)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
       at org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:125)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:549)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot$4.invokeRoot(AjaxViewRoot.java:380)
       at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:53)
       at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:191)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:397)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
       at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:178)
       at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
       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:269)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:208)
       at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:165)
       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:215)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
       at java.lang.Thread.run(Thread.java:595)
      Jun 28, 2007 8:17:57 AM com.sun.faces.lifecycle.LifecycleImpl phase
      WARNING: executePhase(RENDER_RESPONSE 6,org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit@3905e3) threw exception
      java.lang.IllegalStateException: No RenderingContext
       at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:200)
       at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:733)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
       at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:282)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:159)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:97)
       at org.ajax4jsf.framework.renderer.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:150)
       at org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:125)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:549)
       at org.ajax4jsf.framework.ajax.AjaxContext.renderAjaxRegion(AjaxContext.java:307)
       at org.ajax4jsf.framework.ajax.AjaxContext$2.invoke(AjaxContext.java:222)
       at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnComponent(JsfOneOneInvoker.java:75)
       at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnComponent(AjaxContext.java:178)
       at org.ajax4jsf.framework.ajax.AjaxContext.renderSubmittedAjaxRegion(AjaxContext.java:236)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:256)
       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:269)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:208)
       at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:165)
       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:215)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
       at java.lang.Thread.run(Thread.java:595)
      


      If the initial state of the page is that the box is selected and the fields are enabled, selecting the checkbox disables the fields with no problems.

      Here is my test page:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:tr="http://myfaces.apache.org/trinidad"
       xmlns:trh="http://myfaces.apache.org/trinidad/html"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
       <body>
      <!-- <form name="form" jsfc="h:form" prependId="false"> -->
       <form name="form" jsfc="h:form" >
       <input id="custRef" type="text" jsfc="h:inputText"
       required="true" value="#{customer.custRef}"
       label="Customer reference"/><br/>
      
       <h:selectBooleanCheckbox name="hierBill" id="toSend2"
       value="#{customer.hierBill}">
       <f:selectItem itemLabel="Hierarchy Billing"
       itemValue="true"/>
       <a4j:support event="onclick" reRender="hierBillStuff" ajaxSingle="true"/>
       </h:selectBooleanCheckbox>
       <a4j:outputPanel ajaxRendered="true">
       <h:messages/>
       </a4j:outputPanel>
       <a4j:outputPanel id="hierBillStuff">
       <label class="required">Bill period:</label><br/>
       <input type="text" name="billPer" size="10" id="billPer"
       jsfc="h:inputText" value="#{customer.billPeriod}"
       required="true" disabled="#{!createCustBean.hierBill}"/>
       <select name="select" jsfc="h:selectOneListbox" size="1"
       id="billPerFreq"
       value="#{customer.billPeriodFreq}"
       required="true" disabled="#{!createCustBean.hierBill}">
       <f:selectItems value="#{createCustBean.billPeriodFreqs}"/>
       </select>
      
       <label class="required">Next bill date:</label><br/>
       <tr:inputDate id="nextBillDate"
       value="#{customer.nextBillDate}"
       disabled="#{!createCustBean.hierBill}" required="true" />
      
       <label class="required">Number of bills per statement:</label><br />
       <input type="text" name="numBills" id="numBills"
       jsfc="h:inputText" value="#{customer.numBills}"
       disabled="#{!createCustBean.hierBill}" required="true"/>
       </a4j:outputPanel>
       </form>
       <ui:debug hotkey="p" rendered="#{initParam.debugMode}"/>
       <a4j:log hotkey="o"/>
       </body>
      </html>
      
      


      Any help would be appreciated.

        • 1. Re: reRender problem
          Ilya Shaikovsky Master

          Show please your web.xml.

          • 2. Re: reRender problem
            Mike Sauer Newbie

            Sorry about that....

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
             <context-param>
             <param-name>com.sun.faces.verifyObjects</param-name>
             <!-- needs to be false due to woodstock problem -->
             <param-value>false</param-value>
             </context-param>
             <context-param>
             <param-name>com.sun.faces.validateXml</param-name>
             <param-value>true</param-value>
             </context-param>
             <context-param>
             <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
             <param-value>.xhtml</param-value>
             </context-param>
             <context-param>
             <param-name>facelets.DEVELOPMENT</param-name>
             <param-value>true</param-value>
             </context-param>
             <context-param>
             <param-name>facelets.SKIP_COMMENTS</param-name>
             <param-value>true</param-value>
             </context-param>
             <context-param>
             <param-name>debugMode</param-name>
             <param-value>true</param-value>
             </context-param>
             <!-- Trinidad has its own ViewHandler, which is a "decorating"
             view handler - for example, it needs to wrap methods like renderView()
             to perform some extra pre- and post-handling. Facelets, on the other
             hand, is more of a true ViewHandler - it actually implements
             renderView() (yeah, it decorates too, but forget about that
             for a second). As a result, the world is a better place if
             the Trinidad ViewHandler runs around the Facelets ViewHandler.
             But since Facelets is registered in WEB-INF/faces-config.xml,
             and Trinidad's is registered from META-INF/faces-config.xml in its
             JAR, exactly the opposite happens as per the JSF spec.
            
             Hence, the following config parameter, which Trinidad
             exposes to allow pushing a ViewHandler inside
             of ours. FWIW, you retain the entire delegation stack -
             just flipped around a bit - so that Facelets still decorates
             the standard ViewHandler, and therefore you've still got
             JSP support.
             -->
             <context-param>
             <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
             <param-value>com.sun.facelets.FaceletViewHandler</param-value>
             </context-param>
             <context-param>
             <param-name>org.apache.myfaces.trinidad.DEBUG_JAVASCRIPT</param-name>
             <param-value>true</param-value>
             </context-param>
             <!-- Not used, as we've integrated Trinidad
             <context-param>
             <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
             <param-value>com.sun.facelets.FaceletViewHandler</param-value>
             </context-param>
             ajax4jsf -->
             <filter>
             <display-name>Ajax4jsf Filter</display-name>
             <filter-name>ajax4jsf</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
             </filter>
             <filter>
             <filter-name>trinidad</filter-name>
             <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
             </filter>
             <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <servlet-name>Faces Servlet</servlet-name>
             <dispatcher>REQUEST</dispatcher>
             <dispatcher>FORWARD</dispatcher>
             <dispatcher>INCLUDE</dispatcher>
             </filter-mapping>
             <filter-mapping>
             <filter-name>trinidad</filter-name>
             <servlet-name>Faces Servlet</servlet-name>
             </filter-mapping>
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
             <!-- resource loader servlet -->
             <servlet>
             <servlet-name>resources</servlet-name>
             <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
             </servlet>
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.jsf</url-pattern>
             </servlet-mapping>
             <servlet-mapping>
             <servlet-name>resources</servlet-name>
             <url-pattern>/adf/*</url-pattern>
             </servlet-mapping>
            </web-app>
            
            


            My faces config contains the following:
             <application>
            <default-render-kit-id>org.apache.myfaces.trinidad.core</default-render-kit-id>
             </application>
            
            


            • 3. Re: reRender problem
              Mike Sauer Newbie

              I removed Trinidad from my application and now the enabling/disabling works fine.

              • 4. Re: reRender problem
                Ilya Shaikovsky Master

                You should not define view Handlers twice.

                So please remove one of the definitions from web.xml you pasted.

                • 5. Re: reRender problem
                  Mike Sauer Newbie

                  I don't believe I do have the view handlers defined twice. The org.ajax4jsf.VIEW_HANDLERS param is commented out.

                  • 6. Re: reRender problem
                    Mike Sauer Newbie

                    Any other thoughts? I noticed in the source distribution under a a4j-trinidad directory there is a class named TrinidadAjaxContext. Is that supposed to be used somehow?

                    • 7. Re: reRender problem
                      Mike Sauer Newbie

                      I looked into this a little further and discovered that the problem appears to be that the trinidad EditableValueRenderer class expects there to be a FormData object reference. My guess is that since the form element itself is not among my elements to reRender the FormData reference is not being set. I changed by facelet page to have the reRender set to the id of the form. (So the entire form is re-rendered). This now works with the only problem being that I get the following log entry:

                      Jul 2, 2007 12:29:31 PM org.apache.myfaces.trinidadinternal.io.DebugResponseWriter _logDuplicateId
                      WARNING: The id "org.ajax4jsf.view.state" is used more than once.
                      


                      • 8. Re: reRender problem
                        Ilya Shaikovsky Master

                        reRendering of the form isn't good way. put a4j:outputPanel around the content to be updated and point reRender to this panel.

                        • 9. Re: reRender problem with Ajax4JSF and Trinidad
                          Mike Sauer Newbie

                          Thanks. That was how I was originally trying to do this (use an outputPanel around what I wanted rerendered) but that approach resulted in the exception that I originally posted. The problem seems to be that the Trinidad EditableValueRender class (which is the base class of the input field renderers) expects a reference to a FormData object in a rendering context. The FormData object is established in the context when the form element is rendered. In the suggested approach of just rendering the affected fields the form component does not get rerendered so as a result the FormData object reference does not get set and therefore a null pointer results.

                          It appears that Trinidad and Ajax4JSF are incompatible for this type of thing.

                          • 10. Re: reRender problem
                            Mike Sauer Newbie

                            I have also posted this problem to the Trinidad users mailing list under the subject [Trinidad] Problems working with Ajax4JSF. I was trying to determine where the problem lies. A responder said the following:
                            What Trinidad does is that the Form doesn't re-render, but it
                            does tell the PPR subsystem that a subelement of the form *does*
                            need to be copied. So the form as a whole doesn't need to
                            rerender. This works fine in the Trinidad system, but A4J
                            tries to jump right to a single component, which is never going
                            to work for any system that aggregates results during rendering.
                            We'd need a hook exposed by A4J to let Trinidad render those
                            aggregated results.

                            Looks to me that at least for this kind of case Ajax4JSF will not work with Trinidad.

                            • 11. Re: reRender problem with Trinidad
                              Mike Sauer Newbie

                              I posted this problem to the Trinidad mailing list to try to find out if the problem is in Trinidad or Ajax4JSF. I am including the reply below. I am curious to know if anyone else is having this problem.

                              >
                              > My first reaction to this was... since the form was already rendered and we
                              > are just updating a part of the page, this should not be a problem. But my
                              > guess is that in my case where I am taking a form element from disabled to
                              > enabled that the necessary javascript would not have been initially
                              > generated and that I really need to have the form element re-rendered. I
                              > actually did try to have the click on the check box initiate a re-render of
                              > the form. This seemed to work except for the generation of the following
                              > warning...
                              > Jul 2, 2007 12:29:31 PM
                              > org.apache.myfaces.trinidadinternal.io.DebugResponseWriter
                              > _logDuplicateId
                              > WARNING: The id "org.ajax4jsf.view.state" is used more than once.
                              >
                              > When I mentioned this on the Ajax4JSF forum I was told that rerendering the
                              > form is not the right way. I am not sure now based on what you are saying. It seems reasonable to expect that the form
                              > would have to be rerendered.

                              Not exactly.

                              What Trinidad does is that the Form doesn't re-render, but it
                              does tell the PPR subsystem that a subelement of the form *does*
                              need to be copied. So the form as a whole doesn't need to
                              rerender. This works fine in the Trinidad system, but A4J
                              tries to jump right to a single component, which is never going
                              to work for any system that aggregates results during rendering.
                              We'd need a hook exposed by A4J to let Trinidad render those
                              aggregated results.

                              • 12. Re: reRender problem
                                Sergey Smirnov Master

                                A4J does not "jump right to a single component", but renders what you point to. So, point to the right place. I.e. respect the willing of some Trinidad components to be rendered only as a part of the whole form.

                                • 13. Re: reRender problem
                                  Mike Sauer Newbie

                                  Thanks. That is what I had tried to do. There is a post up the stack where I said that I tried re-rendering the form. It worked but I was getting a log warning (please see the previous post). When I asked about that I was told that re-rendering the form is not a good idea.

                                  • 14. Re: reRender problem
                                    Sergey Smirnov Master

                                    reRender the direct parent of the form

                                    1 2 Previous Next