Hey David Thanks for the help! On 30-04-2010, at 2:34 PM, David Holt wrote:
> Hi Paul, > > Begin forwarded message: > >> From: Paul Halliday <[email protected]> >> Date: February 23, 2011 10:19:17 AM PST >> To: [email protected] >> Subject: Re: ERModernDirectToWeb question >> >> Hey David >> >> Hope this post winds up at the right place. >> >> I set up a delegate class and made a rule for it. I set the rule priority >> very high. > > what is your rule? priority: 110 LHS: pageConfiguration = 'QuerySchoolAdmin' RHS: queryDataSourceDelegate RHS Value: "pc2master.app.delegates.SchoolAdminQueryDataSourceDelegate" Assignment: ERDDelayedObjectCreationAssignment > >> I am using the NavigationController and navigation.plist from the ERModern >> example. Heavily modified. > > That should be fine. > >> The navigation tab calls the NavigationController WOComponent for the query >> which returns queryPageForEntityName(SCHOOL_ADMIN) > > You might want to try a named page configuration to limit the impact of your > changes in testing. > > public WOComponent queryDocumentAction() { > ERD2WQueryPage page = (ERD2WQueryPage) > D2W.factory().pageForConfigurationNamed("QuerySchoolAdmin", session()); > ... > } > >> Prior to including the delegate class the QueryPage for the Entity was >> controlled by a rule which limited the query criteria. > > What was that rule? Did it work? Why did you decide not to use the rule? I am still using the rule below priority: 100 LHS: (pageConfiguration = 'QueryEmbeddedSchoolAdmin' or pageConfiguration = 'QuerySchoolAdmin') RHS: displayPropertyKeys RHS Value: ("firstName", "lastName", "adminType", "email", "isActive", "schools.name") Assignment: com.webobjects.directtoweb.Assignment > >> After the inclusion of the delegate class the Query page includes all the >> criteria ie. the controlling rules no longer fire or have the desired >> effect. > > Not sure why this is happening. > >> This also affects All the query pages launched from the navigation tabs for >> all the entities. > > Definitely not sure why this is happening. Sounds like a problem with the > scope of your rule(s) > >> When the find is initiated-- the datasource is not modified as per the >> delegate class -- it doesn't seem to be called. >> >> >> In the delegate class I put the following qualifierFromSenderMethod. >> >> private EOQualifier qualifierFromSender(ERD2WQueryPage sender) { >> NSMutableArray<Object> args = new NSMutableArray<Object>(); >> >> args.addObject(((Session)session()).schoolBoard().boardName()); >> args.addObject(((Session)session()).school().name()); >> EOQualifier qual = >> (EOQualifier.qualifierWithQualifierFormat( " schoolBoard.boardName = %@ and >> schools.name = %@ ", args)); >> ERXAndQualifier finalQual1 = new ERXAndQualifier(new >> NSArray<EOQualifier>(qual, sender.qualifier())); >> return finalQual1; >> } > > the code below assumes the use of the Wonder templates for EOGenerate > > private EOQualifier qualifierFromSender(ERD2WQueryPage sender) { > SchoolBoard sb = (((Session)session()).schoolBoard()); > School aSchool = (((Session)session()).school()); > EOQualifier q = > School_Admin.SCHOOLBOARD.eq(sb).and(School_Admin.SCHOOLS.eq(aSchool)).and(sender.qualifier()); > return q; > } > > >> >> I couldn't seem to get your suggestion to get happy so I formulated the >> above to combine the two qualifiers. >> Any help much appreciated. >> >> Paul >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
