1 2 Previous Next 19 Replies Latest reply on Oct 3, 2007 9:49 AM by Ronan Silva

    Problem scrollableDataTable when use "Rerender"

    Ronan Silva Newbie

      I'm facing a problem with scrollableDataTable, when it isRerender.

      See my code:

      
      <a4j:commandButton reRender="carList" value="Re-render scrollableDataTable" />
      
       <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="400px" width="900px" id="carList" rows="40" columnClasses="col"
       value="#{dataTableScrollerBean.allCars}" var="category" sortMode="multi" >
      
       <rich:column id="make" sortable="true">
       <f:facet name="header">
       <h:outputText styleClass="headerText" value="Make" />
       </f:facet>
       <h:outputText value="#{category.make}" />
       </rich:column>
       <rich:column id="model" sortable="true">
       <f:facet name="header">
       <h:outputText styleClass="headerText" value="Model" />
       </f:facet>
       <h:outputText value="#{category.model}" />
      
       </rich:column>
       <rich:column id="price" sortable="true">
       <f:facet name="header">
       <h:outputText styleClass="headerText" value="Price" />
       </f:facet>
       <h:outputText value="#{category.price}" />
       </rich:column>
       <rich:column id="mileage" sortable="true">
       <f:facet name="header">
      
       <h:outputText styleClass="headerText" value="Mileage" />
       </f:facet>
       <h:outputText value="#{category.mileage}" />
       </rich:column>
       <rich:column width="200px" id="vin" sortable="true">
       <f:facet name="header">
       <h:outputText styleClass="headerText" value="VIN" />
       </f:facet>
       <h:outputText value="#{category.vin}" />
      
       </rich:column>
       <rich:column id="stock" sortable="true">
       <f:facet name="header">
       <h:outputText styleClass="headerText" value="Stock" />
       </f:facet>
       <h:outputText value="#{category.stock}" />
       </rich:column>
      
       </rich:scrollableDataTable>
      
      


      After the ?Rerender? the layout appears stranger.

      somebody knows what is the problem or It's a bug??



        • 1. Re: Problem scrollableDataTable when use
          Maksim Kaszynski Apprentice

          Looks like it's some kind of bug. But needs clarification.

          Could you post some screenshots of broken layout?
          Do you have any exceptions in console?

          • 2. Re: Problem scrollableDataTable when use
            Ronan Silva Newbie

            I do not obtain post screenshots now , but the error occurs when I click in the button ' Re-render scrollableDataTable ', I go to try post the screenshots.

            See my all files:

            My Bean:

            import java.math.BigDecimal;
            import java.util.ArrayList;
            import java.util.Arrays;
            import java.util.List;
            import java.util.Random;
            
            
            public class DataTableScrollerBean {
            
             private static int DECIMALS = 1;
             private static int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;
            
             private List <DemoInventoryItem> allCars = null;
            
             public List <DemoInventoryItem> getAllCars() {
             synchronized (this) {
             if (allCars == null) {
             allCars = new ArrayList<DemoInventoryItem>();
             for (int k = 0; k <= 5; k++) {
             try{
             switch (k) {
             case 0:
             allCars.addAll(createCar("Chevrolet","Corvette", 5));
             allCars.addAll(createCar("Chevrolet","Malibu", 8));
             allCars.addAll(createCar("Chevrolet","S-10", 10));
             allCars.addAll(createCar("Chevrolet","Tahoe", 6));
             break;
            
             case 1:
             allCars.addAll(createCar("Ford","Taurus", 12));
             allCars.addAll(createCar("Ford","Explorer", 11));
             break;
             case 2:
             allCars.addAll(createCar("Nissan","Maxima", 9));
             break;
             case 3:
             allCars.addAll(createCar("Toyota","4-Runner", 7));
             allCars.addAll(createCar("Toyota","Camry", 15));
             allCars.addAll(createCar("Toyota","Avalon", 13));
             break;
             case 4:
             allCars.addAll(createCar("GMC","Sierra", 8));
             allCars.addAll(createCar("GMC","Yukon", 10));
             break;
             case 5:
             allCars.addAll(createCar("Infiniti","G35", 6));
             break;
             /*case 6:
             allCars.addAll(createCar("UAZ","469", 6));
             break;*/
             default:
             break;
             }
             }catch(Exception e){
             System.out.println("!!!!!!loadAllCars Error: " + e.getMessage());
             e.printStackTrace();
             }
             }
             }
             }
            
             return allCars;
             }
            
             public int genRand() {
             return rand(1,10000);
             }
            
             public List <DemoInventoryItem> createCar(String make, String model, int count){
            
             ArrayList <DemoInventoryItem> iiList = null;
            
             try{
             int arrayCount = count;
            
             DemoInventoryItem[] demoInventoryItemArrays = new DemoInventoryItem[arrayCount];
            
             for (int j = 0; j < demoInventoryItemArrays.length; j++){
             DemoInventoryItem ii = new DemoInventoryItem();
            
             ii.setMake(make);
             ii.setModel(model);
             ii.setStock(randomstring(6,7));
             ii.setVin(randomstring(14,15));
             ii.setMileage(new BigDecimal(rand(5000,80000)).setScale(DECIMALS, ROUNDING_MODE));
             ii.setMileageMarket(new BigDecimal(rand(25000,45000)).setScale(DECIMALS, ROUNDING_MODE));
             ii.setPrice(new Integer(rand(15000,55000)));
             ii.setPriceMarket(new BigDecimal(rand(15000,55000)).setScale(DECIMALS, ROUNDING_MODE));
             ii.setDaysLive(rand(1,90));
             ii.setChangeSearches(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
             ii.setChangePrice(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
             ii.setExposure(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
             ii.setActivity(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
             ii.setPrinted(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
             ii.setInquiries(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
             demoInventoryItemArrays[j] = ii;
            
             }
            
             iiList = new ArrayList<DemoInventoryItem>(Arrays.asList(demoInventoryItemArrays));
            
             }catch(Exception e){
             System.out.println("!!!!!!createCategory Error: " + e.getMessage());
             e.printStackTrace();
             }
             return iiList;
             }
            
             public static int rand(int lo, int hi)
             {
             Random rn2 = new Random();
             //System.out.println("**" + lo);
             //System.out.println("**" + hi);
             int n = hi - lo + 1;
             int i = rn2.nextInt() % n;
             if (i < 0)
             i = -i;
             return lo + i;
             }
            
             public static String randomstring(int lo, int hi)
             {
             int n = rand(lo, hi);
             byte b[] = new byte[n];
             for (int i = 0; i < n; i++)
             b = (byte)rand('A', 'Z');
             return new String(b);
             }
            
            
             }
            


            My page:

            <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
            <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
            <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
            <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
            <a4j:form>
             <a4j:commandButton reRender="carList" value="Re-render scrollableDataTable" />
            
             <rich:scrollableDataTable styleClass="" rowKeyVar="rkv" frozenColCount="1" height="400px" width="900px" id="carList" rows="40" columnClasses="col"
             value="#{dataTableScrollerBean.allCars}" var="category" sortMode="multi" style="left: 2px; top: 500px; width: 100%; padding-right: 1px; position: absolute">
            
             <rich:column id="make" sortable="true">
             <f:facet name="header">
             <h:outputText styleClass="headerText" value="Make" />
             </f:facet>
             <h:outputText value="#{category.make}" />
             </rich:column>
             <rich:column id="model" sortable="true">
             <f:facet name="header">
             <h:outputText styleClass="headerText" value="Model" />
             </f:facet>
             <h:outputText value="#{category.model}" />
            
             </rich:column>
             <rich:column id="price" sortable="true">
             <f:facet name="header">
             <h:outputText styleClass="headerText" value="Price" />
             </f:facet>
             <h:outputText value="#{category.price}" />
             </rich:column>
             <rich:column id="mileage" sortable="true">
             <f:facet name="header">
            
             <h:outputText styleClass="headerText" value="Mileage" />
             </f:facet>
             <h:outputText value="#{category.mileage}" />
             </rich:column>
             <rich:column width="200px" id="vin" sortable="true">
             <f:facet name="header">
             <h:outputText styleClass="headerText" value="VIN" />
             </f:facet>
             <h:outputText value="#{category.vin}" />
            
             </rich:column>
             <rich:column id="stock" sortable="true">
             <f:facet name="header">
             <h:outputText styleClass="headerText" value="Stock" />
             </f:facet>
             <a4j:commandLink value="#{category.stock}" action="#{navigateBean.showRow}" />
             </rich:column>
            
             </rich:scrollableDataTable>
            </a4j:form>
            
            




            • 3. Re: Problem scrollableDataTable when use
              Ronan Silva Newbie

              I think that one is bug same, when I 'Rerender' the scrollableDataTable the broken layout and the columns don't move.

              I can send for its email the screenshots?

              Thanks...

              • 4. Re: Problem scrollableDataTable when use
                Maksim Kaszynski Apprentice

                The bug has been fixed.
                Check out RC5.
                Sorry for the late response.

                • 6. Re: Problem scrollableDataTable when use
                  Ronan Silva Newbie

                  Hello maksimkaszynski... thats ok...

                  I tested release RC6, the problem with Rerender continue, when I click my button to 'Rerender' scrollableDataTable or mainForm, the broken layout.

                  Do you want that I send an email screenshots for you?

                  My simple test page:

                  
                   <a4j:commandButton reRender="mainForm" value="Main Form" />
                  
                   <a4j:commandButton reRender="carList" value="Re-render scrollableDataTable" />
                  
                   <rich:scrollableDataTable rowKeyVar="rkv" height="400px" width="900px" id="carList" rows="40" columnClasses="col"
                   value="#{dataTableScrollerBean.allCars}" var="category" sortMode="multi">
                  
                   <rich:column id="make" sortable="true">
                   <f:facet name="header">
                   <h:outputText styleClass="headerText" value="Make" />
                   </f:facet>
                   <h:outputText value="#{category.make}" />
                   </rich:column>
                   <rich:column id="model" sortable="true">
                   <f:facet name="header">
                   <h:outputText styleClass="headerText" value="Model" />
                   </f:facet>
                   <h:outputText value="#{category.model}" />
                  
                   </rich:column>
                   <rich:column id="price" sortable="true">
                   <f:facet name="header">
                   <h:outputText styleClass="headerText" value="Price" />
                   </f:facet>
                   <h:outputText value="#{category.price}" />
                   </rich:column>
                   <rich:column id="mileage" sortable="true">
                   <f:facet name="header">
                  
                   <h:outputText styleClass="headerText" value="Mileage" />
                   </f:facet>
                   <h:outputText value="#{category.mileage}" />
                   </rich:column>
                   <rich:column width="200px" id="vin" sortable="true">
                   <f:facet name="header">
                   <h:outputText styleClass="headerText" value="VIN" />
                   </f:facet>
                   <h:outputText value="#{category.vin}" />
                  
                   </rich:column>
                   <rich:column id="stock" sortable="true">
                   <f:facet name="header">
                   <h:outputText styleClass="headerText" value="Stock" />
                   </f:facet>
                   <a4j:commandLink value="#{category.stock}" action="#{navigateBean.showRow}" />
                   </rich:column>
                  
                   </rich:scrollableDataTable>
                  
                  
                  
                  Thank's a lot for Help maksimkaszynski
                  


                  • 7. Re: Problem scrollableDataTable when use
                    Ronan Silva Newbie

                    Hi maksimkaszynski...

                    I found another error, when use param

                    frozenColCount= " 1 "
                    of ?scrollableDataTable?, when Rerender, it broken and comes back the layout and generates the following exception:

                    
                    [0.0-8080-3] DEBUG com.sun.faces.el.VariableResolverImpl [] - resolveVariable: Resolved variable:org.ajax4jsf.context.AjaxContextImpl@a140c2
                    [0.0-8080-3] ERROR .web].[localhost].[/JSF].[Faces Servlet] [] - Servlet.service() for servlet Faces Servlet threw exception
                    org.ajax4jsf.resource.ResourceNotFoundException: Resource not registered : org.richfaces.renderkit.html.iconimages.ScrollableDataTableIconSortAsc
                     at org.ajax4jsf.resource.ResourceBuilderImpl.getResource(ResourceBuilderImpl.java:393)
                     at org.ajax4jsf.resource.ResourceBuilderImpl.getResourceForKey(ResourceBuilderImpl.java:337)
                     at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:155)
                     at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:144)
                     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:265)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                     at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                     at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                     at java.lang.Thread.run(Thread.java:619)
                    [0.0-8080-1] ERROR .web].[localhost].[/JSF].[Faces Servlet] [] - Servlet.service() for servlet Faces Servlet threw exception
                    org.ajax4jsf.resource.ResourceNotFoundException: Resource not registered : org.richfaces.renderkit.html.iconimages.ScrollableDataTableIconSortAsc
                     at org.ajax4jsf.resource.ResourceBuilderImpl.getResource(ResourceBuilderImpl.java:393)
                     at org.ajax4jsf.resource.ResourceBuilderImpl.getResourceForKey(ResourceBuilderImpl.java:337)
                     at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:155)
                     at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:144)
                     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:265)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                     at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                     at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                     at java.lang.Thread.run(Thread.java:619)
                    
                    


                    Thank's

                    • 8. Re: Problem scrollableDataTable when use
                      Ronan Silva Newbie

                      Hi maksimkaszynski...

                      Do you see this problems?

                      Thanks

                      • 9. Re: Problem scrollableDataTable when use
                        Maksim Kaszynski Apprentice

                        Looks familiar to me. That's problem with our framework and browser cache. I thought that it was fixed long ago. I'll look through jira.

                        • 10. Re: Problem scrollableDataTable when use
                          Maksim Kaszynski Apprentice

                          But exception doesn't relate to the broken layout.

                          There must be something else. Which version of JSF o you use?

                          • 11. Re: Problem scrollableDataTable when use
                            Ronan Silva Newbie

                            JSF 1.1...

                            Thank's for help...

                            • 12. Re: Problem scrollableDataTable when use
                              Ronan Silva Newbie

                              Hi maksimkaszynski...

                              This problem, It's a Bug??

                              • 13. Re: Problem scrollableDataTable when use
                                Ronan Silva Newbie

                                Hi...

                                Thank's for help...

                                I ready email...

                                see my screenshots and app:

                                http://jira.jboss.com/jira/browse/RF-840

                                • 14. Re: Problem scrollableDataTable when use
                                  Maksim Kaszynski Apprentice

                                  Ninho,
                                  Thanks for the screenshots and the example. We are working on it. I'll keep you posted when it's fixed.

                                  1 2 Previous Next