1 2 Previous Next 26 Replies Latest reply on Apr 11, 2009 7:15 AM by nbelaevski Go to original post
      • 15. Re: ExtendedDataTable initialization error
        liuliu

        hi,

        if it is a problem of script, have you tried loadscript strategy or just put a rich:extendeddatatable hidden on a top level?

        hope this helps

        liu

        • 16. Re: ExtendedDataTable initialization error
          skidvd

          I have tried

          <a4j:loadScript src="resource:///org/richfaces/renderkit/html/scripts/extended-data-table.js" />
          
          as I previously posted. This does NOT appear to consistently solve the problem. I have not (but will) also try the hidden rich:extendedDataTable.

          Does anyone know if there are existing Jira issue(s) for this? Are there others experiencing this problem? Are there other workarounds/fixes?

          • 17. Re: ExtendedDataTable initialization error
            adubovsky

            Hello,

            I could not reproduce your problem on my environment.
            Could you please prepare the simplest project with described issue and sens it on my email?

            Thanks for participation.

            • 18. Re: ExtendedDataTable initialization error
              skidvd

              adubovsky and liuliu,

              Sorry for the delay in my reply - I was away for awhile as my wife and I just had a baby...

              Anyway, as I started to work towards a sample test case to reproduce this error, I learned three important things:

              1) Of the two browsers I am working with (Firefox 3.0.2 and IE 7.0.5730), this initialization problem only occurs in Firefox ... it never seems to occur in IE for some reason ... perhaps a clue.... or perhaps meaningless trivia.

              2) Based on liuliu suggestions, I tried the loadscript approach - this had no discernable effect as the problem still occurs. However, based on the second suggestion, adding the following

              <rich:extendedDataTable id="fooTable" value="foo" rendered="false"/>


              to my top level page seems to have provided a work around for the problem as I no longer see the initialization 'bug' - THANKS!!!

              3) The problem seems to stem durectly from the fact that the extendedDataTable is NOT rendered during the initial page load - it is only rendered later in the app life cycle in response to a user hitting a menu item. If I force the inclusion of the extendedDataTable from the initial page load (with or without the fooTable workaround), the problem also goes away. This leads me to suspect that the associated javascript and other important extendedDataTable artifacts are not being correctly added to the composite page when the extendedDataTable is only invoked via ajax request and/or rendered via ajax????

              While I have not had any time to boil my app down to something simple (due to baby concerns and lack of sleep), I provide the above and the following in hopes that you can easily produce this based on this information.....

              My main page has a structure like this....

              <a4j:outputPanel id="contentPanel" style="position: relative; display: block; width: 100%; padding-top: 3px;">
               <rich:panel id="main">
               <f:facet name="header">
               <h:outputText value="#{mainController.contentTitle}"/>
               </f:facet>
              
               <a4j:include viewId="#{mainController.contentView}" id="contentView"/>
               <!-- Bogus table to work around initialization bug -->
               <rich:extendedDataTable id="fooTable" value="foo" rendered="false"/>
               </rich:panel>
               </a4j:outputPanel>
              


              In my case, the menu controls what is included via the #{mainController.contentView}. The menu selection selects what is returned by this component.

              I greatly appreciate your assistance and am hopeful that this will lead to a successful and complete resolution to this issue. Of course, I welcome any thoughts or suggestions you may have if I'm doing something wrong.

              TIA!

              • 19. Re: ExtendedDataTable initialization error
                ilya_shaikovsky

                in my latest 3.3.1 snapshot extended table on include wizard sample placed on step 2 rendered fine.(also not present on initial page load)

                the only additionall difference that I checked on 3.0.8 FF version

                • 20. Re: ExtendedDataTable initialization error
                  skidvd

                  I have produced a simple (as simple as possible anyways) test case that reproduces this behaviour....

                  You will need a simple Controller

                  @Stateful
                  @Scope( ScopeType.SESSION )
                  @Name( "mainController" )
                  public class MainControllerBean
                  {
                   protected String contentView = "/test1.xhtml";
                  
                   public String getContentView()
                   {
                   return contentView;
                   }
                  
                   public void setContentView( String contentView )
                   {
                   this.contentView = contentView;
                   }
                  }
                  


                  And the following three facelets....

                  test.xhtml (Important Note: Comments are important in this one for a subsequent test)
                  
                  <!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:ui="http://java.sun.com/jsf/facelets"
                   xmlns:f="http://java.sun.com/jsf/core"
                   xmlns:h="http://java.sun.com/jsf/html"
                   xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
                   xmlns:rich="http://richfaces.org/rich"
                   xmlns:t="http://myfaces.apache.org/tomahawk"
                   xmlns:ts="http://myfaces.apache.org/sandbox"
                   xmlns:s="http://jboss.com/products/seam/taglib">
                  
                   <f:view>
                   <t:documentBody state="start" />
                   <ui:debug hotkey="d"/>
                  
                   <t:div style="width: 100%; position: relative;">
                   <a4j:outputPanel style="width: 15%; float: left;">
                   <rich:panelMenu mode="ajax" expandSingle="true"
                   iconExpandedGroup="disc" iconCollapsedGroup="disc"
                   iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
                   iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right"
                   styleClass="menuBar" topGroupClass="nav_bg">
                   <rich:panelMenuGroup label="Test">
                   <rich:panelMenuItem label="Go EDT" action="#{mainController.setContentView( '/test2.xhtml' )}" reRender="contentPanel"/>
                   </rich:panelMenuGroup>
                   </rich:panelMenu>
                   </a4j:outputPanel>
                  
                   <a4j:outputPanel style="width: 85%; float: left;">
                   <t:div style="padding-left: 7px; ">
                  
                   <a4j:outputPanel id="contentPanel" style="position: relative; display: block; width: 100%; padding-top: 3px;">
                   <rich:panel id="main">
                   <a4j:include viewId="#{mainController.contentView}" id="contentView"/>
                   <!-- Bogus table to work around initialization bug -->
                   <!--
                   <rich:extendedDataTable id="fooTable" value="foo" rendered="false"/>
                   -->
                   </rich:panel>
                   </a4j:outputPanel>
                   </t:div>
                   </a4j:outputPanel>
                   </t:div>
                  
                   <t:documentBody state="end" />
                  
                   </f:view>
                  
                  </html>
                  


                  test1.xhtml
                  
                  <?xml version="1.0" encoding="UTF-8"?>
                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                  
                  <ui:composition
                   xmlns="http://www.w3.org/1999/xhtml"
                   xmlns:ui="http://java.sun.com/jsf/facelets"
                   xmlns:f="http://java.sun.com/jsf/core"
                   xmlns:h="http://java.sun.com/jsf/html"
                   xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
                   xmlns:rich="http://richfaces.org/rich"
                   xmlns:t="http://myfaces.apache.org/tomahawk"
                   xmlns:ts="http://myfaces.apache.org/sandbox"
                   xmlns:s="http://jboss.com/products/seam/taglib">
                  
                   <a4j:form id="forma">
                   <h:outputText value="START HERE!"/>
                   </a4j:form>
                  
                  </ui:composition>
                  


                  and test2.xhtml
                  <?xml version="1.0" encoding="UTF-8"?>
                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                  
                  <ui:composition
                   xmlns="http://www.w3.org/1999/xhtml"
                   xmlns:ui="http://java.sun.com/jsf/facelets"
                   xmlns:f="http://java.sun.com/jsf/core"
                   xmlns:h="http://java.sun.com/jsf/html"
                   xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
                   xmlns:rich="http://richfaces.org/rich"
                   xmlns:t="http://myfaces.apache.org/tomahawk"
                   xmlns:ts="http://myfaces.apache.org/sandbox"
                   xmlns:s="http://jboss.com/products/seam/taglib">
                  
                   <a4j:form id="testForm">
                   <rich:extendedDataTable id="testTable"
                   value="#{fooVals}" var="testList">
                  
                   <rich:column id="col1" label="Background">
                   <h:outputText value="#{a4jSkin.rowBackgroundColor}" id="col1v"/>
                   </rich:column>
                  
                   <rich:column id="col2" label="Foreground">
                   <h:outputText value="#{a4jSkin.rowForegroundColor}" id="col2v"/>
                   </rich:column>
                   </rich:extendedDataTable>
                   </a4j:form>
                  
                  </ui:composition>
                  
                  


                  Another Important note: Please start with a brand new browser window (as my testing has shown that once an extendedDataTable has successfully been initialized/displayed in the app, then the problem will not manifest again ... this is an initialization problem ... starting with a fresh browser widow will remove this variable.

                  When you navigate to the test.xhtml page, you will be presented with a simple menu on the left and the start page (the contents of test1.xhtml) on the right side. Click on the 'Go EDT' menu item on the 'Test' menu group and the right side will be refreshed with the contents of test2.xhtml (the facelet with the extendedDataTable). At this point the extendedDataTable will render the 'initialization hang' as it will just continually display it's own ajax spinning status indicator until you refresh the page .... refreshing the page makes everything work from that point forward just fine.... The contents of the table are irrelevant in my testing, so none will be presented in this test case.

                  If you then subsequently modify test.xhtml to uncomment the following line
                  <rich:extendedDataTable id="fooTable" value="foo" rendered="false"/>
                  


                  All will work fine from the start... no refresh needed ... even when starting from yet another brand new browser window.

                  This problem only occurs in my Firefox testing. ... but of course, that is our preferred browser. I have not yet been able to upgrade my FF to test versions as I need to remain with locally supported levels. FYI, I'm using the 3.3.1-20090318.084312-43 snapshots for api, impl and ui....

                  I will greatly appreciate any and all help with this and am hopeful that this may finally enable someone to reliably reproduce and hence solve this issue.

                  Regards and TIA!

                  • 21. Re: ExtendedDataTable initialization error
                    adubovsky

                    Hello,

                    I have created the bug in JIRA https://jira.jboss.org/jira/browse/RF-6743

                    But problem seems like resolved if add following in web.xml:

                    <context-param>
                     <param-name>org.richfaces.LoadScriptStrategy</param-name>
                     <param-value>ALL</param-value>
                     </context-param>


                    Thanks.

                    • 22. Re: ExtendedDataTable initialization error
                      skidvd

                      Alexander,

                      Thank you for opening the bug RF-6743. Unfortunately Nick has rejected it as the web.xml file you attached had the RichFaces (ajax4jsf.Filter) in it.

                      My web.xml does NOT include the RichFaces ajax4jsf.Filter and does exhibit the problem. I've attached my web.xml to the JIRA issue. Is there any way you can get this reopened?

                      Thank you again!

                      • 23. Re: ExtendedDataTable initialization error
                        skidvd

                        Alexander,

                        I can confirm that the LoadScriptStrategy workaround that you suggested does workaround the problem. However, if the note in the devguide


                        If you use ALL value of Scripts Load Strategy, the JavaScript files compression turns off!


                        is correct, than I think I prefer my hidden extendedDatatTable work around. Am I missing something?

                        TIA!

                        • 24. Re: ExtendedDataTable initialization error
                          nbelaevski

                          Hello,

                          Hidden extended data table workaround is definitely better, because it does not make you changing load strategy.

                          • 25. Re: ExtendedDataTable initialization error
                            skidvd

                            Thanks Nick,

                            Will you please reopen RF-6743? My web.xml does not have the RichFaces filter and still exhibits the problem.

                            TIA!

                            • 26. Re: ExtendedDataTable initialization error
                              nbelaevski

                              Yes, I'll reopen it, but minimize the priority because workaround exists.

                              1 2 Previous Next