Re: WOBatchNavigationBar and qualifyDisplayGroup()
Adam Rice <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.newbies |
|---|---|
| Message-ID | <BE409C2F.52F8%[email protected]> |
That worked a charm, thanks, but I¹ve obviously done something wrong.
FoundObjects.count() gives me a true count but it is still only registering
as one batch.
What I have on screen, as an example, is a search result saying:
³182 Products² where 182 is an int representing foundObjects.count()
(given that I¹m not that experienced, I was worried that count() would do a
new count every time which would be slow for a large results list where as
referencing a variable would be fast... Feel free to smack me down if I¹m
incorrect), the ³s² in ³Products² is in a conditional where
foundObjectsCount > 1
productDetailDisplayGroup has numberOfObjectsPerBatch = 25 but I see 13
results on screen.
productDetailDisplayGroup.batchCount = 1
productDetailDisplayGroup.hasMultipleBatches = false
What on earth have I done? :)
My code now reads:
productDetailDisplayGroup.queryMatch().setObjectForKey("N", "product.obs");
productDetailDisplayGroup.queryMatch().setObjectForKey("RES", "pricelevel");
NSArray args = new NSArray(new Object[] { "IPOD", "SW", "MON", "ACC" });
String qualifierString = "(product.brand = %@)";
EOQualifier qualifier =
EOQualifier.qualifierWithQualifierFormat(qualifierString, args);
EOFetchSpecification fs = new EOFetchSpecification("productDetail",
qualifier, null);
EOEditingContext ec = session().defaultEditingContext();
NSArray tempResultsArray = ec.objectsWithFetchSpecification(fs);
productDetailDisplayGroup.setObjectArray(tempResultsArray);
productDetailDisplayGroup.qualifyDisplayGroup();
foundObjects =
EOQualifier.filteredArrayWithQualifier(productDetailDisplayGroup.allObjects(
), qualifier);
foundObjectsCount=foundObjects.count();
if(foundObjectsCount==0)
resultsFound = false;
else
resultsFound = true;
if(foundObjectsCount==1)
oneResultFound = true;
else
oneResultFound = false;
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/webobjects-newbies/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/