PDA

View Full Version : When I call setText() on a button the view scrolls back to the top of the page



bryanstrader
28 Dec 2015, 11:02 AM
When I call setText() on a button the view scrolls back to the top of the page, is there some way to prevent the view from scrolling back to the top when I call setText() or setHtml(), they both seem to do the same thing.

jdkhamba
28 Dec 2015, 5:05 PM
Can you post some code or a fiddle demonstrating the issue?

bryanstrader
29 Dec 2015, 10:48 AM
Thanks for the response, but I found a fix. It is a lot of code to deconstruct which is why I was having a hard time finding the problem in the first place. Essentially I had one main container, that I load different views (panels) into, every view but one worked so I couldn't isolate exactly what the difference was between the working views, and the one with the scrolling issue.However, on the view with the issue I simply wrapped the button in another panel with a suspendLayout config set to true. This fixed the issue. It seems that setText() or setHtml() ends up calling doLayout() which scrolls the page back to the top. I still do not know why the symptom only appeared in one view.