In 3.5.12, I am using this code (from Troy Elliot) to control the position of my smart client scrollbar:
application.updateUI(200)
var HowManyRows = forms.ProjectsSpendingForecast.foundset.getSize()
var javaComponent = new Packages.java.lang.ref.SoftReference(forms.ProjectsSpendingForecast).get()
var scrollPosition = (globals.ForecastCurrentIndex)*17
javaComponent.getFormUI().getComponents()[0].getComponents()[0].getVerticalScrollBar().setValue(scrollPosition)
In 5.2, I get this error:
Bad practice: FormController cant be wrapped to javascript (for example not usable as argument in Scheduler plugin)
java.lang.IllegalArgumentException: Bad practice: FormController cant be wrapped to javascript (for example not usable as argument in Scheduler plugin)
Help? This is an important feature in my solution that I cannot lose due to conversion. Thanks in advance.
I did a more powerful implementation of that one which is called Scroller Plus: you can even add listeners to scrollbars and use it to synchronize scrollbars.
Check it out, it’s Open Source, on ServoyForge of course: http://www.servoyforge.net/projects/scroller
Patrick – Thanks so much, I need to synchronize scrollbars for a splitpane too. Do you have any sample code for how to make this work – both the scroll position setting and the listeners?