1 2 Previous Next 29 Replies Latest reply on Mar 19, 2009 7:59 PM by nbelaevski Go to original post
      • 15. Re: NEW FEATURE: Script and Style files loading strategy
        lkoe

        Does this new feature include that you can have standard forward navigation during Ajax request?

        Currently you end up with an unstyled page if you don't configure the navigation as redirect in your faces-config.xml.

        • 16. Re: NEW FEATURE: Script and Style files loading strategy

           

          "lkoe" wrote:
          Does this new feature include that you can have standard forward navigation during Ajax request?

          Currently you end up with an unstyled page if you don't configure the navigation as redirect in your faces-config.xml.


          No relationship.
          In general, all requests to the RichFaces page should pass the filter. Most likely, you have a problem with filter mapping configuration for forward case.

          • 17. Re: NEW FEATURE: Script and Style files loading strategy
            dragospd

            rich:panelMenu doesn't work either

            • 18. Re: NEW FEATURE: Script and Style files loading strategy
              ilya_shaikovsky
              • 19. Re: NEW FEATURE: Script and Style files loading strategy
                andreas.chlupacek

                Guys,

                can anyone confirm that these parameters do work in a portlet / facelets environment? So far, we've had no chance getting this to work with JBoss Portal 2.6.3-GA.

                We are trying to disable loading of the generated CSS snippets, or at least want to be able to have the single consolidated stylesheet referenced in the document's head section. But no matter what we specify for LoadStyleStrategy (independent of COMPRESS_STYLE setting), the result is always the same: we find references to the single, per-component CSS files like:

                <link href="/myPortlet/faces/rfRescss/panel.xcss/DATB/eAGLZKr5DAADWQHL" type="text/css" rel="stylesheet" />


                scattered all over the document's markup. So our portlet app always behaves as if LoadStyleStrategy is set to DEFAULT.


                The following is our web.xml - In case you find something odd here, please give me a hint.

                <?xml version="1.0" encoding="UTF-8"?>
                <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
                
                 <!-- These parameters prevent loading separate style/javascript for each Richfaces components
                 It must be used together with a portal-wide configuration, see jboss-portlet.xml -->
                 <context-param>
                 <param-name>org.richfaces.LoadStyleStrategy</param-name>
                 <param-value>NONE</param-value>
                 </context-param>
                 <context-param>
                 <param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
                 <param-value>false</param-value>
                 </context-param>
                 <context-param>
                 <param-name>org.richfaces.LoadScriptStrategy</param-name>
                 <param-value>NONE</param-value>
                 </context-param>
                 <context-param>
                 <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
                 <param-value>false</param-value>
                 </context-param>
                
                 <context-param>
                 <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
                 <param-value>rfRes</param-value>
                 </context-param>
                 <!-- This is optional parameters for a facelets based application -->
                 <context-param>
                 <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                 <param-value>
                 org.ajax4jsf.portlet.application.FaceletPortletViewHandler
                 </param-value>
                 </context-param>
                 <context-param>
                 <param-name>javax.portlet.faces.renderPolicy</param-name>
                 <param-value>ALWAYS_DELEGATE</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>facelets.VIEW_MAPPINGS</param-name>
                 <param-value>*.xhtml</param-value>
                 </context-param>
                 <context-param>
                 <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                 <param-value>server</param-value>
                 </context-param>
                
                 <filter>
                 <display-name>Ajax4jsf Filter</display-name>
                 <filter-name>ajax4jsf</filter-name>
                 <filter-class>org.ajax4jsf.Filter</filter-class>
                 </filter>
                 <filter-mapping>
                 <filter-name>ajax4jsf</filter-name>
                 <servlet-name>FacesServlet</servlet-name>
                 <dispatcher>FORWARD</dispatcher>
                 <dispatcher>REQUEST</dispatcher>
                 <dispatcher>INCLUDE</dispatcher>
                 </filter-mapping>
                
                 <servlet>
                 <servlet-name>FacesServlet</servlet-name>
                 <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                 <load-on-startup>1</load-on-startup>
                 </servlet>
                 <servlet-mapping>
                 <servlet-name>FacesServlet</servlet-name>
                 <url-pattern>/faces/*</url-pattern>
                 </servlet-mapping>
                
                </web-app>
                
                


                Thanks and regards,
                Andreas.


                • 20. Re: NEW FEATURE: Script and Style files loading strategy
                  sri_hari

                  Hi guys,
                  I am using RichFaces 3.1.3 and Jboss Portal 2.6.3 GA and succefully implemented most of the components. But sometimes
                  i get a JavaScript Error saying "null" is null not an object .
                  and sometimes the style sheets Richfaces does not load.

                  All these problems get solved when i refresh the page.

                  My web.xml

                  
                  <?xml version="1.0"?>
                  <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                   version="2.4">
                  
                   <description>SamplePortlet</description>
                  
                   <context-param>
                   <param-name>org.richfaces.SKIN</param-name>
                   <param-value>blueSky</param-value>
                   </context-param>
                  
                   <context-param>
                   <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                   <param-value>org.ajax4jsf.portlet.application.FaceletPortletViewHandler</param-value>
                   </context-param>
                   <filter>
                   <display-name>Ajax4jsf Filter</display-name>
                   <filter-name>ajax4jsf</filter-name>
                   <filter-class>org.ajax4jsf.Filter</filter-class>
                   </filter>
                  
                   <filter-mapping>
                   <filter-name>ajax4jsf</filter-name>
                   <servlet-name>FacesServlet</servlet-name>
                   <dispatcher>FORWARD</dispatcher>
                   <dispatcher>REQUEST</dispatcher>
                   <dispatcher>INCLUDE</dispatcher>
                   </filter-mapping>
                  
                   <context-param>
                   <param-name>org.richfaces.LoadScriptStrategy</param-name>
                   <param-value>ALL</param-value>
                   </context-param>
                  
                   <context-param>
                   <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
                   <param-value>false</param-value>
                   </context-param>
                  
                  
                   <context-param>
                   <param-name>facelets.DEVELOPMENT</param-name>
                   <param-value>false</param-value>
                   </context-param>
                   <context-param>
                   <param-name>facelets.SKIP_COMMENTS</param-name>
                   <param-value>true</param-value>
                   </context-param>
                   <context-param>
                   <param-name>facelets.VIEW_MAPPINGS</param-name>
                   <param-value>*.xhtml</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>javax.faces.STATE_SAVING_METHOD</param-name>
                   <param-value>server</param-value>
                   </context-param>
                  
                  
                   <listener>
                   <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
                   </listener>
                  
                   <servlet>
                   <servlet-name>FacesServlet</servlet-name>
                   <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                   <load-on-startup>1</load-on-startup>
                   </servlet>
                   <servlet-mapping>
                   <servlet-name>FacesServlet</servlet-name>
                   <url-pattern>/faces/*</url-pattern>
                   </servlet-mapping>
                  
                   <login-config>
                   <auth-method>BASIC</auth-method>
                   </login-config>
                  
                  
                  </web-app>
                  
                  
                  what is the reason for this problem? Is it because of any script loading stratergy?


                  • 21. Re: NEW FEATURE: Script and Style files loading strategy
                    ilya_shaikovsky

                    update please your version to 3.1.4

                    • 22. Re: NEW FEATURE: Script and Style files loading strategy

                      Hi,
                      Is it possible to place all JS (dynamically created by Richfaces) at the bottom of page/template.

                      When I made a performance tune-up of my application (Seam 2 + Richfaces 3.1.3 GA) with Yahoo's YSlow (Firefox addon works together with Firebug), it advices me to put all JS at the page end.
                      I could place my custom JS, but what about dynamically created scripts from Richfaces?

                      Thanks

                      • 23. Re: NEW FEATURE: Script and Style files loading strategy

                        Usually, "put JS at the end of the page" means the inline JS code. Ie. the one that executed immediately, just after loaded. RichFaces includes in the head and puts in the head during Ajax response only the included code, not the one that executed right away.
                        Therefore, there is no any conflict with an advice you mentioned. RichFaces does not move the inline JS code. So, you can put you code wherever you want on the page.

                        • 24. Re: NEW FEATURE: Script and Style files loading strategy
                          altfatterz

                          Hi,

                          We are planning to change from Tomahawk to Richfaces.
                          I have some issues loading the js and css files.
                          We are using sitemesh.
                          With DEFAULT LoadScriptStrategy, the js references are not included to the header part, probably because of sitemesh. So I changed to NONE LoadScriptStrategy and reference the ui.pack.js and framework.pack.js after coping them into my project folder. With the ALL strategy it didn't work, propably because of a sitemesh decorator creates the header part.

                          But what if we would like to use the DEFAULT strategy later? We find the DEFAULT strategy pretty cool.

                          Other thing is with the css. We have a lots of css files and we have found that you have xcss files. This xcss looks pretty cool again but with sitemesh it is not working. Do we have to modify our css files into xcss...?

                          When I access the page for the first time the reference to skins.xcss is not included, but after an ajax request the css link is successfuly included.

                          So my question would be how to set property the script and style file loading with sitemesh?

                          Any idea would be great.
                          Thanks



                          • 25. Re: NEW FEATURE: Script and Style files loading strategy
                            erezharari

                            I'm using RichFaces 3.2.0 and setting org.richfaces.LoadStyleStrategy=ALL.
                            however, i keep getting css snippets sent for each component..
                            i also tried using NONE, but got the same behavior..

                            how can i prevent style loading within the page? i pnly want a single css to be sent.

                            • 26. Re: NEW FEATURE: Script and Style files loading strategy

                               

                              "erezharari" wrote:
                              I'm using RichFaces 3.2.0 and setting org.richfaces.LoadStyleStrategy=ALL.
                              however, i keep getting css snippets sent for each component..
                              i also tried using NONE, but got the same behavior..

                              how can i prevent style loading within the page? i pnly want a single css to be sent.


                              show what you have in the web.xml

                              • 27. Re: NEW FEATURE: Script and Style files loading strategy
                                ilya_shaikovsky

                                and after you'll check that you changes deployed properly - press CTRL + F5 in browser window.

                                • 28. Re: NEW FEATURE: Script and Style files loading strategy
                                  ronanker

                                  Hello !

                                  Where can I find the list of all accepted values of "org.richfaces.ExcludeScripts", please ?

                                  for exemple i want to disable the inclusion of TinyMCE script when loading strategy is "all" ? because my app is using it's own TiniMCE.js ...

                                  (conflict seems to occur in certain cases on IE -> workaround is well positioning the init of our own TinyMCE, in our case just after body...)

                                  • 29. Re: NEW FEATURE: Script and Style files loading strategy
                                    nbelaevski

                                    Hello Ronan,

                                    org.richfaces.ExcludeScripts works in 3.1.x only. You can use new easy configurable tool to assemble scripts into one as you wish: https://www.jboss.org/community/docs/DOC-13329

                                    1 2 Previous Next