开发者

CustomListField using VerticalFieldManager

开发者 https://www.devze.com 2023-04-12 01:25 出处:网络
My requirement is to create a customlistfieldmanager by extending verticalfeildmanager, I am not able to figureout how to do this?

My requirement is to create a customlistfieldmanager by extending verticalfeildmanager, I am not able to figureout how to do this?

I am not able to understand why my manager has ask开发者_StackOverflow中文版ed me to use this method.

any sort of help is welcomed!


It's possible that he's asked you to do this because of the most limiting factor of a normal ListField: you're stuck with uniform heights.

What you'll need to do is have a parent container that is a scrolling VerticalFieldManager. Inside of that will be custom Managers that can handle the same functionality as the row would in a ListField. It needs to accept focus and fire off an event when it's clicked. You'll also need to keep track of what item number it is, so that when it's clicked it knows how to notify any listeners about which one was selected. Also, the parent VFM will need to be able to keep track of which "row" is currently selected -- in this case which one has focus.

Edit for comment

If you add a NullField into each of them it can accept focus but won't actually show up as anything. To determine if a "row" (the Manager) has focus, you can use getFieldWithFocus() on that Manager and the one that doesn't return null is the row that is selected. You will probably also have to do some custom painting to draw the selection highlight


You will have to dynamically add and remove custom elements from your CustomListFieldManager as you add and remove elements from a VerticalFieldManager.

Your manager asked that because he want you to learn how to handle custom object to understand how to use managers.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号