1 2 Previous Next 18 Replies Latest reply on Jul 7, 2008 3:44 AM by ilya_shaikovsky

    rich:dataScroller not working when not in data table footer

    jgreene

      Hi -
      I'm trying to use the rich:dataScroller component outside a rich:dataTable component. I've given the data table an "id" attribute, and I use the "for" attribute in the data scroller to bind it to its data table. But it does not work. I've tried putting the scroller component both inside and outside the rich:dataTable, but that makes no difference. It displays, but does not render any controls. However, if I put the data scroller inside the "footer" facet of the data table, it works fine, but I don't want it there.

      Is there any other attribute I may have forgotten about in either component to make this work? I thought binding it using the "for" attribute was all that was necessary. Thanks for any help.

        • 1. Re: rich:dataScroller not working when not in data table foo
          lmk

          did you add row attribute to dataTable?

          • 2. Re: rich:dataScroller not working when not in data table foo
            lmk

             

            "lmk" wrote:
            did you add row attribute to dataTable?


            rows

            • 3. Re: rich:dataScroller not working when not in data table foo
              jgreene

              Hey -
              Thanks for the replies. Yes, I do have the "rows" attribute set - it works fine in the footer facet of the table, just not outside the table.

              • 4. Re: rich:dataScroller not working when not in data table foo
                lmk

                 

                "jgreene" wrote:
                Hey -
                Thanks for the replies. Yes, I do have the "rows" attribute set - it works fine in the footer facet of the table, just not outside the table.


                and reRender="dataTableId" on dataScroller



                • 5. Re: rich:dataScroller not working when not in data table foo
                  jgreene

                  Thanks again for the reply. Yes, I do have the "reRender" attribute. The only difference between the scroller component I use in the footer and the one I'm TRYING to use outside the data table is that the one in the footer is contained within f:facet tags with name="footer". Here's the relevant markup, which I probably should have included earlier:

                  <rich:datascroller for="accessLogTable"
                   renderIfSinglePage="false" ajaxSingle="true" ignoreDupResponses="true" limitToList="true"
                  align="left" reRender="accessLogTable" />
                  
                   <rich:dataTable id="accessLogTable"
                   value="#{accessFilterBean.accessRecords}"
                   var="accRec"
                   width="98%"
                   rows="2"
                   columnClasses="center"
                   onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
                   onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
                   style="margin-top:4px;">
                  


                  Thanks again for the help. I'm sure that there's something simple I'm overlooking.

                  • 6. Re: rich:dataScroller not working when not in data table foo
                    jgreene

                    Hi again -
                    I've discovered something new in my testing. I'll describe the problem using renderIfSinglePage="true".

                    When the page loads for the first time, a disabled skeleton of the paginator appears - i'm not sure if this is correct, but its OK. When I do my action to generate table contents so that the paginator should now be full of controls and working, the paginator is still "dead" and disabled...until I do a page refresh!!

                    ON the refresh, I navigate back to the page in question, and there is the paginator, alive with its controls in all its glory. This happens the same in both Firefox and IE, and I'm using Richfaces 3.2.1GA.

                    I use the "for" attribute, so the binding is good - I can tell this anyway because when the paginator is "alive", it pages my data fine.

                    I even wrapped the paginator inside an a4j:outputPanel and rerendered it with the data table - something the docs do not indicate to be necessary - same problem. I even added an h:outputText component in the a4j:outputPanel with the paginator, and printed a variable value from my bean to make sure that my rerender effort was working. The variable was updated just like it should be, but of course the paginator was not updated...until of course I did a manual refresh on the page.

                    Keep in mind from my original post that this does not seem to be a problem if I put the paginator in the data table footer, but I don't want it there.

                    Thanks a bunch for any help. This is smelling more and more like a rendering bug, and its taking too much time - I'm sure someone else has seen it if it is. Thanks again.

                    • 7. Re: rich:dataScroller not working when not in data table foo
                      ilya_shaikovsky

                      unfortunatelly as you could see we have two scrollers in our demo and both outside the table. So can't see such bug.. B.t.w. how about your JSF, facelets and etc versions?

                      • 8. Re: rich:dataScroller not working when not in data table foo
                        jgreene

                        Ilya - Thanks for the reply. Yes, that's why i'm a little frustrated with the problem I'm having. But please understand I'm not truly saying the scroller does not work at all outside the data table - my subject line is maybe a poor choice of words. But as my description says, in my application, when I click my "Update" button to execute a query for data, the table is updated via ajax, and if there is enough data so that the scroller should work, the scroller controls do not load - it just stays disabled...unless/until I then click the browser's refresh button to refresh the page. When I refresh the page, the scroller controls load and work, and from that point on, the scroller works fine just like in your demo. Here's the latest markup for how I'm trying to use the scroller:

                         <rich:datascroller for="accessLogTable" align="center" />
                        
                         <a4j:outputPanel layout="block" style="width:960px;min-height:70px;max-height:300px;overflow:auto;">
                        
                         <rich:dataTable id="accessLogTable"
                         value="#{accessFilterBean.accessRecords}"
                         var="accRec"
                         width="98%"
                         rows="2"
                         columnClasses="center"
                         onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
                         onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
                         style="margin-top:4px;">
                        
                         <rich:column sortBy="#{accRec.userId}" rendered="#{accessFilterBean.includeUserId}">
                         <f:facet name="header">
                         <h:outputText value="User Id"/>
                         </f:facet>
                         <h:outputText value="#{accRec.userId}" />
                         </rich:column>
                         <rich:column sortBy="#{accRec.username}" rendered="#{accessFilterBean.includeUsername}">
                        ...
                        


                        Ilya - if I take the same scroller markup and put it in a "footer" for the data table just like the RF docs say, everything works fine, so maybe there's something special I am not doing in order for it to work outside the data table. Unfortunately, I can't use it in the footer of the data table in my app. Thanks for any more help.

                        BTW, we are using jsf1.2_04. we tried upgrading to latest version a while back, but had problems. we'll be trying to upgrade again soon, though. I believe our facelets version is 1.1.14.


                        • 9. Re: rich:dataScroller not working when not in data table foo
                          jgreene

                          Ilya - One more thing. The Richfaces demo loads with data already in the table. My application does not. It is up to the user to select some filter params first before data is retrieved. So this boundary condition is different. When the data table is rerendered with enough data, the scroller controls should work, of course. This is the problem I'm having. I have to refresh the page at this point for the controls to take effect and start working.

                          • 10. Re: rich:dataScroller not working when not in data table foo
                            jgreene

                            Ilya -
                            I just ran a test so that my page loaded with data already in the table, similar to the Richfaces scroller demo. The scroller controls work right away, just like in the demo. So there does indeed seem to be some kind of problem(bug?) when the data table is not rendered with data when the page initially loads, then is rerendered as a result of a data retrieval action.

                            As far as my application goes, I may be able to work around this now that I know what it takes to get the scroller controls to load and work, but it still may be a bug in the rendering phase.

                            What are your thoughts now?

                            • 11. Re: rich:dataScroller not working when not in data table foo
                              jchouinard

                              Well if you update your table with ajax, you need an id to your scroller and rerender it too

                              • 12. Re: rich:dataScroller not working when not in data table foo
                                jgreene

                                Thanks for the tip, but I've tried that too, but to no avail.

                                • 13. Re: rich:dataScroller not working when not in data table foo
                                  jchouinard

                                  Well if I may insist, i'm doing exactly the same thing and it works just fine. Since you were updating your table, your scroller was updated in the same time. Now that it's outside, it does not.

                                  I use :

                                  <rich:datascroller for="projects" page="#{scrollerPage}" id="sc1" styleClass="scroller" renderIfSinglePage="false"/>


                                  And add the rerender to some field updating the result list :
                                  <h:inputText value="#{projectList.filterNameValue}" id="filterName" styleClass="value2">
                                   <a:support event="onkeyup" reRender="sc1,projects"
                                   ignoreDupResponses="true" requestDelay="700" focus="filterName" />
                                   </h:inputText>

                                  And it works just fine

                                  • 14. Re: rich:dataScroller not working when not in data table foo
                                    jgreene

                                    Thanks for the response again. I'm willing to try your suggestion, but let make sure I understand.

                                    My table is updated and rerendered in response to an a4j:commandButton. I'm not sure I understand what your h:inputText field is, and are you suggesting that I provide some delay before the datascroller is updated?

                                    1 2 Previous Next