RR loop confusion....
RR loop confusion....
- Subject: RR loop confusion....
- From: Florijan Stamenkovic <email@hidden>
- Date: Mon, 25 Jul 2005 19:57:15 +0200
Hi all...
Bumped into something I really can not figure out. Any help would be
greatly appreciated.
I got a repetition that has a list binding to a method returning
NSArray. Method is called resultsPerPage(). After logging the RR loop I
saw that the resultsPerPage() method gets called in just about every
stage of the loop. If I clicked on a submit within a form, it gets
called in takeValuesFromRequest (the repetition the method is bound to
is NOT within the form), in invokeAction, and finally in
appendToResponse... Why??? Not to mention that the methods that are
invoked (component actions) do not invoke it. The only binding /
invocation is the repetition itself (checked).
/*************
Skippable details:
The problem became visible when I started using NSRange within the
resultsPerPage(). It throws exceptions because it's second argument is
negative. The cause of that is that resultsPerPage() is using two
variables: delimiter(how many results per page) and currentPage. The
problem appears because delimiter can be changed during
takeValuesForRequest as it is bound to a text field. The currentPage
gets reset to 1 during invokeAction, a precaution taken not to end up
with attempting to display a page that actually is no longer there (if
the update delimiter is so big that there is no need for so many
pages). The delimiter is in a form that has a single button that is
bound to a method that resets the currentPage to 1. So, it is
impossible to change the delimiter without invoking that particular
method. However, as the resultsPerPage() method gets called before
invokeAction(), the delimiter is updated to a different value, but the
currentPage is still on the old value, what can result in gibberish
values when determining the range of the array that should be returned
as a subarray of the bigger, cached array..
********/
So, how come that a key method gets invoked so many times during the RR
loop?? Does anybody have a better solution to having a dynamically
resolved subset of a search query?
TIA
Flor
oh - just to note that I have used this a lot now, but not utilizing
NSRange, but by copying manually records into a NSMutableArray, and
checking that I am not out of bounds. Which of course resulted in an
empty array in all the RR stages before the response were really
generated, but that didn't throw any exceptions. The generated response
had all the numbers right of cours...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden