I finally got around to using Flex Builder 3 for my personal projects since the project I am working for migrated to it awhile back. Call me a late adopter.
Generally when you think of pagination, you might think immediately about returned search results from google. You know, the little arrows down at the bottom indicating the previous and next pages with links to the pages in between them. Now to me, a RIA will hopefully find a better means of implementing paginated data, whether that be via internal scrollbars or collapsible/expandable* content. But sometimes a design or use-case doesn’t allow for it. A good implementation of this can be found on the Kuler app.
I really like their implementation but since that design and custom functionality might not fit with a future design/use-case I wanted to find a reusable solution. So how does one go about formalizing that sort of functionality?
The first step is to disconnect the functionality from the design implementation. An interface is a good candidate for this as it ensures that regardless of the UI, you can expect a certain feature set. Enter IPaginatedItemsControl. I won’t go into detail about it as you can read the docs but suffice it to say that this is the starting point for building any paginated items control. The next step is actually building out some of the functionality and making a container to host the custom controls. Check out PaginatedItemsControlBase. Its basically an empty box with most of the needed functionality. All it lacks are the controls in order to browse the paginated content. Some might ask why I even bothered with any interface. This was intended to allow a developer to customize the inner workings of the implementor if they found the PaginatedItemsControlBase too restrictive.
Anyway, I have a new build on the project home as well as updated documentation on all the jwoLib components. Certainly sound off as I appreciate the feedback and criticism.
* Being somewhat of a English/grammar guy, I really don’t understand the rules for adjective modifiers. Logic would suggest that since collapse and expand are antonyms that their adjective modifier would be the same: verb + modifier. This is not the case though. It seems there is no rhyme or reason to how these modifiers are selected. Anyone?