Re: WOBatchNavigationBar and qualifyDisplayGroup()
Lawrence Kendall <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.newbies |
|---|---|
| Message-ID | <[email protected]> |
I have tried this before as well but haven't had any success.
The way I got round it was to use an NSArray as a class variable and
reference it. I also had to abandon the WOBatchNavigationBar and
create my own. It's easy though.
All you do is create the table the way you want it (I use 3 columns in
a table that is 80% of the window width) and add your strings and
buttons etc. Then use the methods from the WODisplayGroup to hook it
up. You will use the displayPreviousBatch, displayNextBatch,
currentBatchIndex and batchCount. For the total objects found you will
need to hook up the foundObjects.count.
So:
public NSArray foundObjects = null;
Then in my search method:
foundObjects =
EOQualifier.filteredArrayWithQualifier(productDetailDisplayGroup.allObje
cts(), new EOOrQualifier(qualifier));
Then in the WO, hook up the foundObjects.count to your
totalFoundObjects string.
I also put a conditional around mine so it only displays the bar if
there are objects in the array. If there are no objects it displays a
"No Matching Product Records Found" message instead.
As far as I can tell there is no way in which to use the
detailDisplayGroup with the WOBatchNavigationBar. This is exactly how
I got round the issue and I use it in a number of applications for
clients. If you do find a way to use the WOBatchNavigationBar in this
way, be sure to post it :)
If you need any more help, let me know.
Good Luck.
Larry.
On 21/02/2005, at 4:56 PM, Adam Rice wrote:
I've done a little reading and know why these two don't go together but
can't find a solution.
I've I use qualifyDataSource() I do not get the results I'm looking
for.
My search currently reads as:
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();
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 the Yahoo! Terms of
Service.
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/