Pages

Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Wednesday, December 17, 2014

Scroll to top on Commit or Rollback

Scroll to top on Commit or Rollback

This post is about scrolling to some component on user action. Mostly when user click save or cancel, a message is displayed on top of the page. At the same time, it is required to scroll the page to top and show message to the user... rather user scrolling up to see what happened. 

Implementation is simple : 

1. Need a javascript method to scroll.

2. Next step is just to invoke this javascript method at the end of your commit call.


Enjoy!!

Calling JavaScript from ManagedBean

Calling JavaScript from ManagedBean

Often there are requirements to call the invoke javascript from actionListener to set focus or scroll etc. Here goes the code to invoke javascript : 


Enjoy !!!