Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: JSR-314
    • Labels:
      None
    1. clientBehaviorHolderRendersIdAndName.patch
      54 kB
      Jakob Korherr
    2. fajax.patch
      9 kB
      Leonardo Uribe
    3. my-basic-ajax-demo.zip
      6 kB
      Dominik Dejmek
    4. myfaces-2323.xhtml
      2 kB
      Leonardo Uribe

      Issue Links

        Activity

        Hide
        lu4242 Leonardo Uribe added a comment -

        Added implementation of this tag, but still it is not tested because we need other parts working to see if something is missing.

        Show
        lu4242 Leonardo Uribe added a comment - Added implementation of this tag, but still it is not tested because we need other parts working to see if something is missing.
        Hide
        lu4242 Leonardo Uribe added a comment -

        Testing basic-ajax demo with myfaces I have found two problems:

        1. Components that renders client behaviors should always render "id" and "name" attribute.
        2. if f:ajax is on a page, it should be created automatically a component that register and render jsf.js javascript with target head.

        Show
        lu4242 Leonardo Uribe added a comment - Testing basic-ajax demo with myfaces I have found two problems: 1. Components that renders client behaviors should always render "id" and "name" attribute. 2. if f:ajax is on a page, it should be created automatically a component that register and render jsf.js javascript with target head.
        Hide
        jakobkorherr Jakob Korherr added a comment -

        Here is my patch for the first point of the TODO. I also included a test for every component that is a ClientBehaviorHolder.

        BTW: HtmlLabelRenderer was the only affected renderer, which has not got a base implementation in shared-core.

        Show
        jakobkorherr Jakob Korherr added a comment - Here is my patch for the first point of the TODO. I also included a test for every component that is a ClientBehaviorHolder. BTW: HtmlLabelRenderer was the only affected renderer, which has not got a base implementation in shared-core.
        Hide
        lu4242 Leonardo Uribe added a comment -

        I have checked the patch and it looks great, so I'll committed that one. Thanks Jakob for provide this patch.

        Show
        lu4242 Leonardo Uribe added a comment - I have checked the patch and it looks great, so I'll committed that one. Thanks Jakob for provide this patch.
        Hide
        lu4242 Leonardo Uribe added a comment -

        Committed solution for the second part of problems found. There is still one problem with basic-ajax demo (ajax redirect does not work as expected).

        Show
        lu4242 Leonardo Uribe added a comment - Committed solution for the second part of problems found. There is still one problem with basic-ajax demo (ajax redirect does not work as expected).
        Hide
        lu4242 Leonardo Uribe added a comment -

        There is still some pending stuff on f:ajax, related to its behavior when it has child components. Right now this one only works when it is inside components. See jsf spec 2.0 section 10.4.1.1

        Show
        lu4242 Leonardo Uribe added a comment - There is still some pending stuff on f:ajax, related to its behavior when it has child components. Right now this one only works when it is inside components. See jsf spec 2.0 section 10.4.1.1
        Hide
        jakobkorherr Jakob Korherr added a comment -

        I tried to run f:ajax yesterday and I found out that the following still does not work:
        2. if f:ajax is on a page, it should be created automatically a component that register and render jsf.js javascript with target head.

        I tried some different versions, but the jsf.js was never included in the rendered html, however every version worked well in mojarra.

        Show
        jakobkorherr Jakob Korherr added a comment - I tried to run f:ajax yesterday and I found out that the following still does not work: 2. if f:ajax is on a page, it should be created automatically a component that register and render jsf.js javascript with target head. I tried some different versions, but the jsf.js was never included in the rendered html, however every version worked well in mojarra.
        Hide
        lu4242 Leonardo Uribe added a comment -

        Maybe some changes done in the last days in UIComponent.setParent causes the problem.

        Show
        lu4242 Leonardo Uribe added a comment - Maybe some changes done in the last days in UIComponent.setParent causes the problem.
        Hide
        ddejmek Dominik Dejmek added a comment - - edited

        I tried this small demo (my-basic-ajax-demo.zip, works with "mvn jetty:run") and after the second change of an inputfield a NullPointerException occurs.

        and the StackTrace:
        javax.servlet.ServletException
        at javax.faces.webapp.FacesServlet._handleStandardRequest(FacesServlet.java:456)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:182)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:637)
        Caused by: java.lang.NullPointerException
        at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreView(DefaultFaceletsStateManagementStrategy.java:174)
        at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:374)
        at org.apache.myfaces.view.ViewDeclarationLanguageBase.restoreView(ViewDeclarationLanguageBase.java:106)
        at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.restoreView(FaceletViewDeclarationLanguage.java:925)
        at org.apache.myfaces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:231)
        at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:106)
        at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:129)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:85)
        at javax.faces.webapp.FacesServlet._handleStandardRequest(FacesServlet.java:421)

        Show
        ddejmek Dominik Dejmek added a comment - - edited I tried this small demo (my-basic-ajax-demo.zip, works with "mvn jetty:run") and after the second change of an inputfield a NullPointerException occurs. and the StackTrace: javax.servlet.ServletException at javax.faces.webapp.FacesServlet._handleStandardRequest(FacesServlet.java:456) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:182) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:637) Caused by: java.lang.NullPointerException at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreView(DefaultFaceletsStateManagementStrategy.java:174) at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:374) at org.apache.myfaces.view.ViewDeclarationLanguageBase.restoreView(ViewDeclarationLanguageBase.java:106) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.restoreView(FaceletViewDeclarationLanguage.java:925) at org.apache.myfaces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:231) at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:106) at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:129) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:85) at javax.faces.webapp.FacesServlet._handleStandardRequest(FacesServlet.java:421)
        Hide
        lu4242 Leonardo Uribe added a comment -

        Ok, I have committed the solution. It was a problem with server side state saving again, but now the demo run without problem.

        Show
        lu4242 Leonardo Uribe added a comment - Ok, I have committed the solution. It was a problem with server side state saving again, but now the demo run without problem.
        Hide
        jakobkorherr Jakob Korherr added a comment -

        And 2. if f:ajax is on a page, it should be created automatically a component that register and render jsf.js javascript with target head. does NOT work again.

        But at the moment <h:outputScript name="jsf.js" library="javax.faces" target="head"/> does not work either, so maybe it's a problem with h:outputScript.

        Has anyone an idea?

        Show
        jakobkorherr Jakob Korherr added a comment - And 2. if f:ajax is on a page, it should be created automatically a component that register and render jsf.js javascript with target head. does NOT work again. But at the moment <h:outputScript name="jsf.js" library="javax.faces" target="head"/> does not work either, so maybe it's a problem with h:outputScript. Has anyone an idea?
        Hide
        lu4242 Leonardo Uribe added a comment -

        Patch proposed by Dominik Dejmek to solve problem nested components inside f:ajax tag. Test it still pending.

        Show
        lu4242 Leonardo Uribe added a comment - Patch proposed by Dominik Dejmek to solve problem nested components inside f:ajax tag. Test it still pending.
        Hide
        lu4242 Leonardo Uribe added a comment -

        Committed fix for 2. if f:ajax is on a page, it should be created automatically a component that register and render jsf.js javascript with target head. does NOT work again.

        The problem is first a bad check for a param and second we should generate an id to the h:outputScript added component, so UIViewRoot.addComponentResource could recognize it and add it to the tree.

        Show
        lu4242 Leonardo Uribe added a comment - Committed fix for 2. if f:ajax is on a page, it should be created automatically a component that register and render jsf.js javascript with target head. does NOT work again. The problem is first a bad check for a param and second we should generate an id to the h:outputScript added component, so UIViewRoot.addComponentResource could recognize it and add it to the tree.
        Hide
        lu4242 Leonardo Uribe added a comment -

        Committed solution to solve problem nested components inside f:ajax tag. I did my own alternative from scratch based on jsf 2.0 spec section 10.4.1.1, some tests also committed and then I compared it with the other proposed solution to see if something was missing. I also solved one problem with id generation of the created h:outputScript by AjaxHandler, since we should take into account the component will be relocated to be a children of UIViewRoot.

        Unfortunately, since there is no way to "attach" client behaviors from composite components inner children (there is no composite:clientBehavior tag but it should be and in fact it exists in ri, but it is silently ignored by the spec), I can't test if this part is working well but anyway one solution was proposed.

        Show
        lu4242 Leonardo Uribe added a comment - Committed solution to solve problem nested components inside f:ajax tag. I did my own alternative from scratch based on jsf 2.0 spec section 10.4.1.1, some tests also committed and then I compared it with the other proposed solution to see if something was missing. I also solved one problem with id generation of the created h:outputScript by AjaxHandler, since we should take into account the component will be relocated to be a children of UIViewRoot. Unfortunately, since there is no way to "attach" client behaviors from composite components inner children (there is no composite:clientBehavior tag but it should be and in fact it exists in ri, but it is silently ignored by the spec), I can't test if this part is working well but anyway one solution was proposed.
        Hide
        lu4242 Leonardo Uribe added a comment -

        I'll close this one because we did everything we can in that part. It was confirmed that cc:clientBehavior exists, but at this time, the javadoc does not show that, so I suppose this one will be on jsf 2.0 rev A. When the time comes, well test the missing stuff (possible interaction cc:clientBehavior - f:ajax).

        Show
        lu4242 Leonardo Uribe added a comment - I'll close this one because we did everything we can in that part. It was confirmed that cc:clientBehavior exists, but at this time, the javadoc does not show that, so I suppose this one will be on jsf 2.0 rev A. When the time comes, well test the missing stuff (possible interaction cc:clientBehavior - f:ajax).

          People

          • Assignee:
            lu4242 Leonardo Uribe
            Reporter:
            lu4242 Leonardo Uribe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development