5 Replies Latest reply on Oct 29, 2010 8:00 AM by heckerbob

    Master Detail Reference

    heckerbob

      Hi All, I want to contruct a sample master detail page. I looked at the example below and it seems to do what I want. As soon as a row is clicked some detail information is displayed in an other table.

       

      http://livedemo.exadel.com/richfaces-demo/richfaces/extendedDataTable.jsf

       

      If I look at the source I see the master data table triggers the detail window with a Ajax event when a different row is selected (see below). What I don't understand is how the actual data is referenced from the master to the detail table. Somehow the data of the selected row is passed to the detail window. I asume this is done using the extendedTableBean.takeSelection method? But how is this method implemented? How does it work?

       

      <a4j:support reRender="selectiontable" id="extended_table_bean_take_selection"
                          action="#{extendedTableBean.takeSelection}"
                          event="onselectionchange" />

       

      Thanks.

        • 1. Re: Master Detail Reference
          ilya_shaikovsky

          http://jboss.org/richfaces/demos - get full samples of demo from svn. unfortunatelly the page lacks bean source.

          • 2. Re: Master Detail Reference
            heckerbob

            Thanks for the reply but I don't seem to get it work, even with the source code. I must be missing something... it should be easy to create a master detail setup or not? I can get a key from the selection variable (from the extended data table) but I don't seem to be able to get the real information with this key?

             

            Is this not the correct way to implement a master detail window? Is there a more simple way I didn't find?

            • 3. Re: Master Detail Reference
              ilya_shaikovsky
              it should be easy to create a master detail setup or not?

              yes, it's pretty easy and if you downloaded sources check the ExtendedTableBean.java which contains the method you loking for.

              • 4. Re: Master Detail Reference
                heckerbob

                Thanks for the direction I finaly got the master detail working with the example code but I still see a problem. When you sort the page the id's of the selected rows change (localy) but the order of the managed bean (server) doesn't change. So de detail pane display's the wrong data. Is there a way to solve this without writing server side code to re-sort the server side list on each click?

                • 5. Re: Master Detail Reference
                  heckerbob

                  Anyone got a easy solution for the resorting problem? Or is the only way to solve this problem to code a server side sort method that is triggered when the column headers are clicked?