Html Area Scrollbar

Hi!

I have a HTML_Area which I show in the webclient. It has a dataprovider, logText, which I update with the work that has been done.
Now how I would like the vertical scrollbar to behave, is that it scrolls to the bottom, when I update the logtText dataprovider. So you always see the last line that is added.

But I just can’t figure out how to do that. I tried to set the Y scroll to an high number, but it just stays on top every time.

Does anyone knows how this works?

Thanks!

So no one? :(

Bummer…

Not sure if this will help but in a basic web page you can do it like the following:

var textarea = document.getElementById('textarea_id');
textarea.scrollTop = textarea.scrollHeight;

You can also do it with jQuery like so:

$(document).ready(function(){
    $('#textarea_id').scrollTop($('#textarea_id')[0].scrollHeight);
});

You can use the Web Client Utils plugins (Overview - Web Client Utils - ServoyForge) to get the actual ID of your rendered textarea and replace the ‘textarea_id’ above with what the plugin returns. This is all theroy at this point because I have not tried it yet but if I get some time today I’ll test it out myself and let you know what I find. Hope that helps!

Keith

I built a sample solution and that process worked like a charm. I’ve attached it for you to review. Enjoy!

test.servoy (6.11 KB)