1 Reply Latest reply on Oct 19, 2011 3:23 AM by Pål Bergan

    onCompleteHandler called for rich:tabPanel

    Pål Bergan Newbie

      I have added som Java script code to be run when I click a h:commandLink. The js code is called on the 'oncomplete' event handler. The link is on a rich:tabPanel component. What I try to do is to scroll the rich:extendedDataTable which is on the panel to active/selected row after the commandlink is clicked. When I debug the script I see that the table is scrolled correct, but the problem is that after my script is run richfaces calls the onCompleteHandler of the tabPanel. After that code is run the table is scrolled back so that the first row is again the topmost and visible one. When i debug out of my script I see in the debugger that the following is run on the oncomplete handler. Why is the Richfaces onCompleteHandler added as can be seen in the code snipped below that I copied from the call stack.

       

      (function(event) {$skd.fokus('');tabellBrgrScroll();tabellBrkoScroll();;RichFaces.$('form:papiroppgaverResultatPanel').onCompleteHandler('informasjonsgrupper');;

      })

        • 1. Re: onCompleteHandler called for rich:tabPanel
          Pål Bergan Newbie

          From togglePanel.js.jsf code the following code is run:

           

          /**        

          * please, remove this method when client side ajax events will be added        

          *        

          * */       

          onCompleteHandler : function (newItemName) {
                      var oldItem = this.__getItemByName(this.activeItem);
                      var newItem = this.__getItemByName(newItemName);           

          // Don't do like this and remove it ASAP           

          this.__itemsSwitcher().execClient(oldItem, newItem);
               },       

          },

           

          The scrolling is done during the execClient call. From the comments it seems like this method should never be run.