I have multiple rows on a table and when i click on a button (ice:command Link) from one row i want to scroll to bottom of page. I tried to use a java script function on the on click event but the issue is that after the scroll go's down it comes right back to the button clicked.
function onclickToBottom()
{
window.scrollTo(0, document.body.scrollHeight);
}
Is there a way to prevent that like an javascript event that would run after all icefaces javascript done executing ?? thanks !
I guess you have an action listener for your ice:commandLink
?. May be that's why you are experiencing such a behavior.
There are two options you can try.
addJavascriptCall
method of com.icesoft.faces.context.effects.JavascriptContext
to call your script within the actionListener. This means, you shouldn't have an onclick script in your link.<a>
instead of <ice:commandLink>
and add your script call to onclick event. You can just style it using ICEfaces style classes.