Java Wicket - Calling javascript ( JQuery ) before AJAX

Posted by user1428051 on Stack Overflow See other posts from Stack Overflow or by user1428051
Published on 2012-05-31T09:53:51Z Indexed on 2012/05/31 10:41 UTC
Read the original article Hit count: 147

Filed under:
|
|
|

I got this thing i'm trying to solve: I got a ListView created using Wicket ( 1.5 ) with a lot of elements and a scroll. When new items are available, the user is asked if he would like to refresh the list via a message backed by an AjaxLink:

public void onClick(AjaxRequestTarget ajaxTarget) {
  /* do something ... */                    
  ajaxTarget.addComponent(_list);
}

So on click the list gets reloaded and the scroll position is reset to zero. Is there any way i can call JavaScript before the list reloads the save the scroll position?

(I know how to get/save the scroll position ( .scrollTop() ) , i just don't know how to call a function right before AJAX ).

© Stack Overflow or respective owner

Related posts about java

Related posts about JavaScript