9 Replies Latest reply on Feb 24, 2011 4:48 AM by ascen gonzalez

    ExtendedDataTable refreshing

    ascen gonzalez Newbie

      When I select one element in the extendedDataTable and back to the extendedDataTable, it scrolls to top again.

      I want that the table stay like it was when I selected that element

      What shall I do?

        • 1. ExtendedDataTable refreshing
          Mark Paluch Master

          Hi Ascen,

          have you set the selection-Property to a Value-Binding? You probably need to store the selection-State. It would help, to have some code to answer your Question.

           

          Best regards,

          Mark

          • 2. ExtendedDataTable refreshing
            ascen gonzalez Newbie

            My code is:

             

                <rich:extendedDataTable id="horarios" var="fila"

                        value="#{listaHorariosBean.listHorasDiario}" height="200px" width="500px"    >

                      <rich:column >

                           ......

                       <rich:column >

                            <table>

                            <tr>

                                <td colspan="2">

                                    <div class="listHistot">

                                        <h:commandLink

                                            actionListener="#{listaHorariosBean.setearHora}"  reRender="listhorarios">

                                            <h:outputText value="Ver Fichajes" />

                                        <f:param id="fecha" name="fecha" value="#{fila.fecha}"  pattern="dd/MM/yyyy"/>

                                        </h:commandLink>

                                    </div>

                                </td>

                            </tr>

                            </table>              

                             </rich:column>

                    </rich:extendedDataTable>

               

                    <rich:dataTable id="listhorarios" var="histhor" value="#{listaHorariosBean.listFichajes}" width="50%" rows="8">       

             

                            <rich:column >

                                <f:facet name="header">HORA</f:facet>

                                <h:outputText value="#{histhor.hora}" />

                            </rich:column>

                 .....

            • 3. ExtendedDataTable refreshing
              Mark Paluch Master

              try:

              <rich:extendedDataTable id="horarios" var="fila"

                          value="#{listaHorariosBean.listHorasDiario}" activeRowKey="{listaHorariosBean.activeRowKey}" height="200px" width="500px"    >

               

              and add an Object-Property "activeRowKey" to your Bean. This should save the current selection. A similar Thread is http://community.jboss.org/message/49756

              • 4. ExtendedDataTable refreshing
                ascen gonzalez Newbie

                I did and The row selected is marked, but the SCROLL BAR come back to the BEGINNING

                Is it posible that this work?

                • 5. ExtendedDataTable refreshing
                  Tim Gottwald Newbie

                  I have the same problem workin with Richfaces 3.3.2 and using the "selection" properity.

                  The use of activeRowKey does not work at all. No getting or setting call.

                  Any idea, solution or hint where to look?

                  • 6. ExtendedDataTable refreshing
                    ascen gonzalez Newbie

                    I'm sorry but I did still not find any solution.

                    • 7. ExtendedDataTable refreshing
                      Mark Paluch Master

                      Hi Ascen,

                      have you tried to create a JavaScript arround the Table? Try to get the current Scroller-Position from the Table, store it via JavaScript in a Bean (before you fire your JSF Action) and restore Scroller-Position on return.

                       

                      Best regards,

                      Mark

                      • 8. ExtendedDataTable refreshing
                        Tim Gottwald Newbie

                        I found a solution for my case but it has nothing to do with richfaces in particular.

                        In the self defined skin of my application I changed the border of the selected rows to a 2px width. This change leads to the scrolling on top.

                        Only for your info. Greetings from Luxembourg

                        • 9. ExtendedDataTable refreshing
                          ascen gonzalez Newbie

                          Thank you Tim, but my problem is the opposite. I want the scrolling on the position where I do click. By default the scroll bar goes to the top.