7 Replies Latest reply on Apr 14, 2010 7:00 AM by Harut Sargsyan

    datatable scrollable doesn't works fine

    victor bernado Newbie

      Hi!!

       

      I'm developing a project using richfaces, and I could see that (now) at every tables where I use scrollbar doesn't works fine. I'm saying that when I use scrollbar (I don't know how explain it) but if I put over the scrollbar, mouse pointer change to icon to click it, but if I click, it doesn't do nothing...

      I try put the scrollbar at the header table, and before table. When scrollbar is into the header of table when I click on the numbers this doesn't change, but when the scrollbar is before table, the selected page change, but table doesn't modify...

      Obviously, first I try whit only one scrollbar, but it doesn't works

       

      I put the code of a table that doesn't works:

      <h:form>
          <rich:datascroller     align="left"
                              for="literaltable"
                              maxPages="20"
                              selectedStyle="font-weight: bold"/>
          <rich:dataTable     value="#{literals.dataList}"
                              var="var"
                              id="literaltable"
                              width="100%"
                              rows="5"
                              >
                         
              <f:facet name="header">
                  <rich:datascroller align="left" for="literaltable" maxPages="20"  rendered="true"
                          selectedStyle="font-weight: bold"/>
              </f:facet>
              <rich:column>
                  <f:facet name="header">
                      <h:outputText value="#{literalsstr.key}"/>
                  </f:facet>
                  <h:outputText value="#{var.key}" title="#{var.key}"/>
              </rich:column>
             
              <rich:column>
                  <f:facet name="header">
                      <h:outputText value="#{literalsstr.ca}"/>
                  </f:facet>
                  <h:inputText value="#{var.ca}" title="#{var.ca}" />
              </rich:column>
             
              <rich:column    >
                  <f:facet name="header">
                      <h:outputText value="#{literalsstr.sp}"/>
                  </f:facet>
                  <h:inputText value="#{var.sp}" title="#{var.sp}" />
              </rich:column>
             
              <rich:column    >
                  <f:facet name="header">
                      <h:outputText value="#{literalsstr.en}"/>
                  </f:facet>
                  <h:inputText value="#{var.en}" title="#{var.en}" />
              </rich:column>
             
              <rich:column    >
                  <f:facet name="header">
                      <h:outputText value="#{literalsstr.fr}"/>
                  </f:facet>
                  <h:inputText value="#{var.fr}" title="#{var.fr}" />
              </rich:column>
          </rich:dataTable>
      </h:form>

       

      I see at the html code of jsf page, that table is named:

      <table class="rich-table " id="j_id151:literaltable"

      I try to change for attribute of scrollbar to j_id151:literaltable but nothing change

       

      I'm not sure, but could be that this problems where caused by use seam?? because I think that before use seam it works fine

       

      At the image below you can see the two scrollbar, firts is at the 3 page, but second doesn't change

       

      Thanks

        • 1. Re: datatable scrollable doesn't works fine
          Nick Belaevski Master

          Hi Victor,

           

          This should work either with Seam or without it.

           

          Can you please clarify on the problem: is datascroller component outside the table switches data table pages or not?

          For the datascroller nested in table: try adding it explicitly to the reRender attribute of table.

          • 2. Re: datatable scrollable doesn't works fine
            victor bernado Newbie

            Hi Nick,

             

            I will try to clarify the problem but is too difficult. Basically the problem is that when I switch between pages at the scrollbar, the table doesn't change. Now I try to debug de property #{literals.dataList} that obtain the list to binding the datatable, and when I click on some number of scrollbar the bean literals is called on getDataList

             

            Now I try this:

            <rich:datascroller align="left" for="literaltable" maxPages="20"
                        page="#{literals.page}" reRender="sc2" id="sc1" />
                <rich:dataTable     value="#{literals.dataList}"
                                    var="var"
                                    id="literaltable"
                                    sortMode="simple"
                                    width="100%"
                                    rendered="true"
                                    styleClass="pfcLiteralDataList"
                                    rows="5"
                                    reRender="sc2,sc1"
                                    >
                    <rich:column    sortBy="#{var.key}">
                        <f:facet name="header">
                            <h:outputText value="#{literalsstr.key}"/>
                        </f:facet>
                        <h:outputText value="#{var.key}" title="#{var.key}"/>
                    </rich:column>
                   
                    <rich:column    sortBy="#{var.ca}">
                        <f:facet name="header">
                            <h:outputText value="#{literalsstr.ca}"/>
                        </f:facet>
                        <h:inputText value="#{var.ca}" title="#{var.ca}" />
                    </rich:column>
                   
                    <rich:column    sortBy="#{var.sp}">
                        <f:facet name="header">
                            <h:outputText value="#{literalsstr.sp}"/>
                        </f:facet>
                        <h:inputText value="#{var.sp}" title="#{var.sp}" />
                    </rich:column>
                   
                    <rich:column    sortBy="#{var.en}">
                        <f:facet name="header">
                            <h:outputText value="#{literalsstr.en}"/>
                        </f:facet>
                        <h:inputText value="#{var.en}" title="#{var.en}" />
                    </rich:column>
                   
                    <rich:column    sortBy="#{var.fr}">
                        <f:facet name="header">
                            <h:outputText value="#{literalsstr.fr}"/>
                        </f:facet>
                        <h:inputText value="#{var.fr}" title="#{var.fr}" />
                    </rich:column>
                    <f:facet name="footer">
                        <rich:datascroller align="left" for="literaltable" maxPages="20"
                        page="#{literals.page}" id="sc2" reRender="sc1" />
                    </f:facet>
                </rich:dataTable>

            that is very very similar to exadel richfaces example, but it doesn't works...

             

            I put two pics, at the first pic you can see that the 4 page is selected, and at the second image page selected is 10, and the datalist rendered is the same

             

            thanks

            • 3. Re: datatable scrollable doesn't works fine
              Nick Belaevski Master

              Hi Victor,

               

              Try adding a4j:log to the page and check if there are any errors/warnings there.

              • 4. Re: datatable scrollable doesn't works fine
                victor bernado Newbie

                Hey!!

                I try it, and one time it works ok (only adding the ajax:log the scroollbar works) but the other times ajax:log output this:

                warn[13:46:43,920]: Node for replace by response with id j_id124:literaltable:0 not found in document

                I find the html generated code, and it's too ugly to put here, is in the file above (literaltable.txt)

                • 5. Re: datatable scrollable doesn't works fine
                  Harut Sargsyan Apprentice

                  What is the scope of the bean "literals"?

                  If it has request scope, than add a4j:keepalive declaration for it (or change the scope to session) and problem will be fixed...

                  • 6. Re: datatable scrollable doesn't works fine
                    victor bernado Newbie

                    Hi Harut,

                     

                    First of all, thanks.

                    "literals" bean was in request scope, yes. I try the two methods (with ajax:keepalive and changing the scope) but anyone solves the problem. ajax:log output is

                         warn[12:23:09,905]: Node for replace by response with id j_id123:literaltable:0 not found in document

                     

                    Finding the string "j_id123:literaltable" at html code, I find:

                    <table class="rich-table pfcLiteralDataList" id="j_id123:literaltable"
                    <th class="rich-table-subheadercell  " scope="col" id="j_id123:literaltable:j_id131header"
                    and others

                    and finding "j_id123:literaltable:0" :

                    <td class="rich-table-cell " id="j_id123:literaltable:0:j_id131">
                    <td class="rich-table-cell " id="j_id123:literaltable:0:j_id134">
                    <input type="text" name="j_id123:literaltable:0:j_id136"
                    <td class="rich-table-cell " id="j_id123:literaltable:0:j_id137">
                    and more


                    • 7. Re: datatable scrollable doesn't works fine
                      Harut Sargsyan Apprentice

                      Hi Victor,

                           anyway, if your bean is in request scope, then datascroller will not update the table... This is the point you have to take into account. So the first   step to solve the problem is to change the scope to session (or add keepalive declaration in your page <a4j:keepAlive beanName="literals"/>) this is necessary.

                      Unfortunately no idea why it is not working even after changing the scope to session as you mentioned in your previous post... Anyway I will write if I will find anything else regarding that problem...