Hi David, 

I think I have a hack for you. The context is almost the same:
I need to write a QueryDataSourceDelegate which filters EOs when a user click 
on the search button of an ERMODEditRelationshipPage page. The filter is based 
on the parent object who is unknown at this stage (or I didn't find it). 

So when you get the parent object, you get then entity.

In the delegate, I get the sender that is a ERD2WQueryPage object then I use 
the following code (client is an ivar of my delegate):

if (client == null)
{
        boolean flag = true;
        WOComponent comp = sender.parent();
        /* We loop until we find the right component who knows the NOClient 
object.
         * The first one is an instance of ERMODEditRelationshipPage.
         */
        do 
        {
                if (comp == null || comp instanceof ERMODEditRelationshipPage)
                        flag = false;
                else
                        comp = comp.parent();
        } while (flag);
        if (comp != null)
                client = (NOClient) 
((ERMODEditRelationshipPage)comp).masterObject();
}
if (client != null)
{
        NSArray<String> logins = (NSArray<String>) 
client.contractors().valueForKey(NOUser.Keys.LOGIN);
        EOQualifier qualClient = NOUser.Keys.CLIENT_KEY.isNot(client);
        qual = new EOAndQualifier(new NSArray(new EOQualifier[] {qual, 
NOUser.Keys.LOGIN_KEY.notIn(logins), qualClient}));
}
return qual;

And as you write your own custom component, you should be able to include some 
piece of code like this one.

Philippe - @prabier

On 16 févr. 2012, at 18:59, David Holt wrote:

> Hi all,
> 
> Can I reference the entity in an inspect page (the parent page configuration) 
> from a list embedded in the same page?
> 
> I need to manipulate an array of to-many objects in the inspect page (group 
> them) in code before returning the list. I need to access the 
> parentEntity.toManyRelationship, but I'm not seeing how that might be done.
> 
> I am using a custom component for my embedded list that displays a table per 
> group.
> 
> Thanks,
> David
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/prabier%40me.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to