Hi Paul,

Begin forwarded message:

> From: Paul Halliday <phalli...@rogers.com>
> Date: February 23, 2011 10:19:17 AM PST
> To: programming...@mac.com
> 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?

> 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?

> 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      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to