0

Scrolling to a certain position in Listbox

asked 2011-10-06 09:54:29 +0800

valmar gravatar image valmar
925 2 13
http://www.timo-ernst.net

Hi,

I got a Listbox here where no items are selected.

I scroll to the middle of the listbox.

Then, I refresh its model (via lb.setModel(model);) which causes the listbox to automatically scroll back up.

Is there a way to save the last position of the listbox scroll bar and set it as the "new" scroll position after refreshing the listbox?

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2011-10-06 10:30:15 +0800

Bobzk gravatar image Bobzk
444 1 8

I think your problem is to identify which listbox item is in view before the refresh because you can always use :-

Clients.scrollIntoView(comp)

To reposition the listbox.

But which one is in view? What I mean her is that if they have not selected anything then which item is in view? The top one displayed, the middle or the bottom one? There are multiple items in view depending on how many of the total listbox entries your ZUL display at any one time.

Best of luck. Perhaps have a mold="paging" listbox instead?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-10-06 09:54:29 +0800

Seen: 305 times

Last updated: Oct 06 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More