Subject: RE: Full &RestrictToCategory support - anyone else?
Thanks for looking further into the issue, Dick. While I do like the idea, I’m not a huge fan because (a) the functionality already exists to do this (albeit requiring numerous views) and (b) I think the work involved by the dev group would be fairly extensive.
I also want to expand on my request for pagination information in ?ReadViewEntries. I’ve got a great replacement for the Java view applet that is completely AJAX. It’s been in production for 7 months now, and has been battle-tested by several thousand Internet users with great results. It has virtually all of the advantages of the view applet, including:
-
Multiple views on one page
-
Various parameters (restrict to category, every-other-row shading, “show select column”, etc.)
-
“Starts with” functionality
-
User-definable “count per-page”
-
Fully CSS-enabled rendering
It pulls down the view design XML, renders icons in columns, allows click-sorting, etc.
It works with IE 5.0+, Netscape 6.1+, and Firefox 1.0+. No ActiveX required, etc., etc. I’d love to send it to you if you’d like to have a look.
The only real disadvantage with the application is with navigation. You currently have to navigate with Next/Previous buttons. This is where the ?ReadViewEntries pagination info would really come in useful. Here’s why:
How my naviation works
Next Page - the “Next Page” button simply looks at your last entry of your current result set and sets your &Start to that. No big deal. The effect is virtually identical to how the HTML-rendered views work. It also adds your current &Start parameter to an in-memory stack (more on that in a second).
Previous Page - the “Previous Page” button doesn’t have a clue as to how to go “back” 50 entries (or 100, or whatever your current &Count is). It simply doesn’t know what your new &Start needs to be, unless it can always assume there are no readers fields involved. So what it does is pop your last &Start parameter off of the stack I mentioned above. This works great except when you use the “Starts with” functionality offered by &StartKey. In that case “Previous” simply jumps you back to the beginning of the view.
How this can be vastly improved with (I think) almost no effort from IBM/Lotus Dev:
If we were to receive a “priorpagestart” attribute in ?ReadViewEntries then we could have true “Previous page” functionality, regardless of our current &Start parameter (or &StartKey, for that matter) or how we got there. I mentioned this in my other post: the logic’s already there with the HTTP engine – HTML views calculate this attribute for their own “Previous” button – so I think this could be added to ?ReadViewEntries pretty easily.
How this can be perfected
“Page X of Y” navigation - this is a simple concept, visible on virtually every web-based record navigator that we’ve all seen.
The problem with implementing such a solution with ?ReadViewEntries is that there is no way of knowing how many entries are in the view that are visible to the current user. I’ve done some hunting and experimentation, though, and discovered an undocumented attribute called “rangeentries” that appears to do so – sometimes.
If you use ?ReadViewEntries with both a &StartKey and &UntilKey parameter, you are returned a “rangeentries” attribute, which appears to be the number of entries visible to the current user for the result set.
So theoretically if you know the first and last entries in the view you can use &StartKey and &UntilKey to receive this attribute, but there are a few roadblocks:
First of all, you’ve got to get the first and last entries in the view in order to know what parameters to use with &StartKey and &UntilKey.
Second of all, &StartKey only works with text or date-valued columns (i.e. any views sorting off a number column are out-of-luck).
Thirdly, even if you do manage to get an &StartKey value (say, with a script agent) and try to assume an end-of-alphabet &UntilKey of “&UntilKey=~”, you won’t get any category entries that are “not categorized”.
In order to know the size of a view we’ll need the “rangeentries” attribute to always be returned (or a new parameter with a similar effect). Ideally it would also take into account any &Expand arguments in affect. E.g. if a collapsed, categorized view initially has 20 visible entries and a category is expanded that has 5 more inside of it, the attribute should return a count of 25.
If we can get that, then the only thing missing would be the ability to jump to a particular page, e.g. “jump” from page 6 to page 10. In order to do that, though, we would need to know the &Start parameter to use. In order to take this into account with reader’s fields the ?ReadViewEntries result set would have to return some page info, e.g.:
<— notice the sudden jump? readers fields are hiding some docs!
This could be a performance killer on huge views, though. But here’s the catch: we don’t need all of this page information – only some of it. E.g. A typical navigation interface is similar to:
Page: 1 2 [3] 4 5 … 27
We only need a bit of info for this – the prior 2 pages to the current page, the next 2 pages, and always the first and last.
One final note: the view applet uses some other undocumented arguments such as &Navigate, &SkipNavigate, and &EndView=1. I’m not sure if those would address any of our concerns, but if they could then simply documenting those would be a great help.
Whew! I’ve written a book! Thanks again Dick, and to anybody else who is taking the time to read this.