var elm = $("#formId\\:componentId");
smoothScroll(elm);
Put below code in some js file and pass the id of component for which validation fails to scroll to that component. If you want the scroll goes in up everytime when validation fail then pass Id of some component that is there in top of dialog.
Please note that this is client side. So you need to pass Id which appear in your browser when you inspect element in browser.
Hope this will help you.
function smoothScroll(elm) {
var startY = currentYPosition();
var stopY = elmYPosition(elm);
var distance = stopY > startY ? stopY - startY : startY - stopY;
if (distance < 100) {
scrollTo(0, stopY); return;
}
var speed = Math.round(distance / 100);
speed=speed+12;
if (speed >= 20) speed = 20;
var step = Math.round(distance / 50);
var leapY = stopY > startY ? startY + step : startY - step;
var timer = 0;
if (stopY > startY) {
for ( var i=startY; i<stopY; i+=step ) {
setTimeout("window.scrollTo(0, "+leapY+")", timer * speed);
leapY += step; if (leapY > stopY) leapY = stopY; timer++;
} return;
}
for ( var i=startY; i>stopY; i-=step ) {
setTimeout("window.scrollTo(0, "+leapY+")", timer * speed);
leapY -= step; if (leapY < stopY) leapY = stopY; timer++;
}
}