How to stop the JSF form from moving to the top of the screen after an AJAX call
This question has been asked but the answers provided are either outdated or none JSF specific. Is there any easy way in JSF ( perhaps a missing technicality in using JSF ) that will prevent the JSF form from returning to the top of the page after an AJAX update?
This is the best answer I have so far:
stop scrolling to top after AJAX request
But I can't seem to get a straight answer out of them on how to apply this to my JSF. I am using Redhat JBoss Developer Studio and the latest JSF 2.0 ( I think it'll do 2.2, the option is there, haven't tried it yet). Also, making use of RichFaces and Primefaces.
The best answer so far refers to telling JavaScript to return a 'false' but how to do this from within JSF or without too much trouble trying to override it's internal functions:
You need to replace href="#tabs-1" for each li with
href="javascript:void(0);" or write a function that would do
that for you or href="" and add 'return false;' at the end of
your onclick function . #tabs-1 creates an html anchor that pushes
the page to the top.
You come highly recommended on the forms, I am hoping you might know all about this.
Thanks,
Perry