Thanks for the - ahem - Suggestion, Thomas. :-)
I hadn't known about this functionality; the problem with it, in the codebase I'm working in, is that there is no standard among service calls (and the actual code doing the database queries within some EJBs) about how many rows of data are to be returned. We have a requirement for a "Show more..." suggestion, but also for a "There are too many rows to display, please refine your query" suggestion. Neither suggestion can be driven by the server side, it has to be the GUI telling the server "This is a request for my concept of the base limit of suggestions" and "This is a request for my concept of the MAX limit of suggestions". The BASE and MAX values will differ in different locations in the GUI, even though they might be making the same back-end call.
Thus, the GUI has to tell the server "I want 10 suggestions, and that is the base request amount"; when "Show more..." is clicked, it has to tell the server "I want 20 suggestions, and that is the max request amount". It also needs to tell the server "Actually query for BASE+X, but only return BASE suggestions".
I have gotten this to work on the GUI side by creating an extended SuggestBox class that modifies it's own limit, and keeps track of if it just requested the BASE or MAX amounts. The problem with this, still, is that the server doesn't know how many extra rows to query for.
So it would be nice to be able to pass some more information along with my SuggestOracle.Request (as well as the SuggestOracle.Response) that gives context to the SuggestBox, so our subclass SuggestBox can be used thoughout the GUI, with just BASE, MAX, and X parameters set.
Perhaps I'm missing something - hey, I've done it before :-) - but I still feel it would be lovely to be able to pass some more contextual information back and forth in the Request and Response objects somehow. I've worked on this by wrapping the SuggestOracle.Request object in another object that contains this context (intercepted in requestSuggestions()), and subclassed SuggestOracle.Response to wrap this context on the way back.
If you can think of a better way of passing this extra context back and forth in a generalized way, however, I'd love to know about it.
- Tim