2 Replies Latest reply on Mar 1, 2012 10:13 AM by Tristan Dyer

    Add oncomplete to rich:extendedDataTable sort call

    Tristan Dyer Newbie

      Hi,

       

      For various reasons I am looking to use the javascript API to call the sort method on my extended data table.

       

      The sorting works fine, my only issue is that I have multiple forms on my page, and Ajax call's only add the viewstate to the current form. This means that all my other forms are not updated with the viewstate and then I start getting weird issues with my conversation.

       

      Is there any way to add an oncomplete handler to an extendedDataTable so that I can manually add the viewState to all of the forms on my page?

       

      I haven't tried any of the other features, like lazy loading the rows, but I assume they would have the same issue as sorting.

       

      I am using Richfaces 4.2 and Weld 1.1.5 in Tomcat 7

       

      Thanks in advance!

        • 1. Re: Add oncomplete to rich:extendedDataTable sort call
          Tristan Dyer Newbie

          I can use the non-javascript way of sorting as shown on the showcase site, but I am left with the same issue with any of the other AJAX features of this element such as lazy loading rows, resizing/reordering columns etc.

           

          Is there any way to easily disable those features completely, so I dont run into issues with my viewstate/conversation?

           

          Thanks,

           

          Tristan

          • 2. Re: Add oncomplete to rich:extendedDataTable sort call
            Tristan Dyer Newbie

            Ok,

             

            So I fixed this in case anybody else is having issues like this.

             

            I added this in a jQuery ready function.

             

            if (typeof jsf != 'undefined' && jsf.ajax) {

                jsf.ajax.addOnEvent(completeViewState);

            }

             

            Which calls my function to add the view state to every form. This way I dont need to worry what initiates the request, the view state is taken care of each and every time.

             

            It adds to the event instead of replacing, so if i need extra processing that will happen too.