Implementing Sequential Navigation
Our docbase records now provide one answer to “Where can I go
from here?”—you can go to any of the tabbed indexes. But
they don’t say anything about “Where am I?” beyond
the plain facts evident in the records themselves. There’s no
notion of sequence. It’s true that you can get to the next or
previous record in the company
index by way of its
tabbed-index page. That is, you can go to the
company
tabbed-index page for the current record,
then select its predecessor or successor. But that’s far more
cumbersome than the sequential controls we saw in Figure 7.1. There, another answer to “Where am
I?” is “In the company (or analyst, or product...)
index.” And another answer to “Where can I go from
here?” is “To the next (or previous) company (or analyst,
or product...).”
What’s
needed, then, is a way to map from a record number to its predecessor
or successor, relative to any of the indexes. The first step was to
save the sequences of record numbers that were only implicit in the
structures we built for the tabbed-index controls. We accomplished
that in _enumerateRecords( )
, which, as we saw
in Example 7.8, walks the tab structures and builds
a new structure with ordered lists of record numbers for each index.
These ordered lists are necessary, but not sufficient, for the sequential controls. For each record, we need the record number of its predecessor (if any) and its successor (if any), relative to each index. While we’re at it, let’s capture ...
Get Practical Internet Groupware now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.