7 Replies Latest reply on Nov 24, 2011 9:05 PM by bleathem

    Issue with <rich:toolbar/> after migrating to Richfaces 4

    marius.bogoevici

      An example app is in https://gist.github.com/1390261.

       

      When commenting out the <rich:toolbar/> element (and sub-elements) in header.xhtml, the inplaceInput control works fine, but as soon as the code is uncommented, the inplaceInput control is permanently disabled.

       

      Not sure what is causing this - similar code used to work in Richfaces 3.3 and I cannot find anything in the docs that explains this.

       

      Thanks!

        • 1. Re: Issue with <rich:toolbar/> after migrating to Richfaces 4
          bleathem

          Hi Marius,

           

          Do you get any output in the javascript error console of your browser?  Any errors in the server log?

           

          Brian

          • 2. Re: Issue with <rich:toolbar/> after migrating to Richfaces 4
            marius.bogoevici

            Not as far as I can tell. Neither Firebug is telling me too much.

             

            I tried to compare the generated pages with and without the toolbar, but it cannot see anything besides the javascript.

            • 3. Re: Issue with <rich:toolbar/> after migrating to Richfaces 4
              bleathem

              Running your application, I get the error in chrome:

              Uncaught TypeError: Cannot read property 'InplaceInput' of undefined

               

              I am able to get it to work if I comment out the resource mapping in the web.xml:

              <!--                                                                                                                                
                  <context-param>                                                                                                                 
                      <param-name>org.richfaces.resourceMapping.enabled</param-name>                                                              
                      <param-value>true</param-value>                                                                                             
                  </context-param>                                                                                                                
              -->
              

               

              I wonder if one of those componentsthe resource it's looking for is not included in the mapping file.  I'll dig in a bit further, and post back.

              • 4. Re: Issue with <rich:toolbar/> after migrating to Richfaces 4
                bleathem

                Marius, you've uncovered a bug for us, thanks!

                 

                I talked through the problem with Lukas, and it turns out the problem is the toolbar is calling for it's javascript resource first (and doesn't itslef require the jsf.js resource).  When resourceMapping is disabled, this works fine, as the toolbar js doesn't require jsf.js.

                 

                However, when using resourceMapping, the toolbar.js requirement brings in packed.js, which does need jsf.js.  hence the error is thrown.  Fixing this is rigorously is tricky, as we are limited in how we can interact with the JSF resource loader.

                 

                I'll dig in further, and post back.

                • 5. Re: Issue with <rich:toolbar/> after migrating to Richfaces 4
                  marius.bogoevici

                  Thanks, Brian!

                   

                  I'll avoid using <rich:toolbar/> for now - thanks for confirming where the issue actually was.

                   

                  Marius

                  • 6. Re: Issue with <rich:toolbar/> after migrating to Richfaces 4
                    bleathem

                    Having had a good look at the hooks JSF provides into resource hadnling, we've determined a fix for this is out of scope for 4.1.0.

                     

                    however, we have a workaround.  If you include an ajax enabled component in your template, it will make sure the call for jsf.js occurs before the call for packed.js.  I low impact component to include is something like:

                     

                    <a4j:jsFunction name="_nothing"/>
                    

                     

                    Trying this out in the example appication provided resolves the problem.

                    • 7. Re: Issue with <rich:toolbar/> after migrating to Richfaces 4
                      bleathem

                      I created a jira to track this issue:

                      https://issues.jboss.org/browse/RF-11739