views:

540

answers:

3

I have a list control that uses a custom itemRenderer and custom itemEditor. The itemRenderer/Editor are textarea controls with at least 3 lines of text each.

The default scrolling nature of a list control is by Item, rather than by some number of pixels, the way a VBOX scrolls.

I want my list control to have more of a word-processor look, where scrolling down will scroll one line of text at a time. Because each list item holds at least 3 lines of text, scrolling down skips all three and positions the next list item at the top of the list control.

Any suggesitons?

I was trying to figure out how to write a custom VBOX that could act like a list, but I'm new to flex -- and I've only been programming for a year. ....Not really sure where to start.

Thanks!

A: 

Use the Spark List control from Flex 4 (the beta is available). Its "Scroller" interface is much more flexible.

an0nym0usc0ward
(possibly) dumb question... If I design this component on my machine with Flex 4, can it be compiled, and later incorporated in a larger Flex 3 project our company is building? I'm not sure how that works.Otherwise it sadly won't do many any good
Matt H.
A: 

Haven't gotten an answer to my comment, regarding the use of a FLex 4 component in our app.

However, I have deduced that it isn't possible to have a smooth-scrolling List with variable row height, if my requirements are a large list with lots of controls.

Because the list control does not instantiate all of its items at once, it can't determine the needed min and max scroll values based on the total height of all controls. It can only determine these values from the NUMBER of controls it contains. Bummer :-(

Matt H.
A: 

Matt, I've developed a component that extends VBox that supports itemRenderer and dataProvider properties. It works very well. Wish I could share the code, but I developed it for my employer. I could probably explain how though, if it is helpful.

This technique does create a useful list component that supports smooth scrolling. It also has the ability to support dynamic sized components. The obvious downside is, it will of course instantiate all the children. Only useful if you use a reasonably sized list.

Dan Martin
Thanks dan, but I'm looking at a control with 500 items in the list, each containing 5 textareas. Yikes!
Matt H.