Using a scrollbar in LZX is so deceptively simple, that developers often have a hard time figuring it out. Below is an example of a scrollbar in action:
There are two LZX classes you can use to make a view scroll its contents: scrollbar and hscrollbar. scrollbar is vertical; hscrollbar is horizontal. The two orientations will work together automatically. The scrollbar is designed to scroll a single view within a clipping container. i.e. if you want to scroll multiple views (which you almost always will), you should wrap them in a single containing view.The diagram below shows the layout of views:


Some guidelines:
- The clipping view should have a defined width and height. It’s OK if they are constraints.
- The clipping view must clip its contents. (clip=”true”).
- The scrolling view must not have a defined height. Exploit the stretchy behavior of views here.
- Define a width for the scrolling view, so that it leaves room for the scrollbar.
- The scrollbar and scrolling view must be siblings. If not, you’ll have to set the target attribute.
1 response so far ↓
1 Antun’s Blog » Blog Archive » The Mouse Wheel in OpenLaszlo // Aug 3, 2007 at 10:28 am
[...] Antun’s Blog Notes on OpenLaszlo, LZX and Rich Internet Application Development « OpenLaszlo 4.0.3 Released… stretches, and mini-me! [...]
Leave a Comment