Re: Qualifying a DisplayGroup in WOO
Re: Qualifying a DisplayGroup in WOO
- Subject: Re: Qualifying a DisplayGroup in WOO
- From: Don Lindsay via Webobjects-dev <email@hidden>
- Date: Mon, 12 Oct 2020 12:09:15 -0500
Thanks
> On Oct 12, 2020, at 10:45, Hugi Thordarson via Webobjects-dev
> <email@hidden> wrote:
>
> Hi Don,
> it's been ages since I've used DisplayGroups, but it does seem like you're
> missing an invocation of qualifyDisplayGroup() (if you want to filter objects
> already in the DG) or qualifyDataSource() (to perform an entirely new fetch)
> on the DG to actually do anything with the qualifier you've set.
>
> Cheers,
> - hugi
>
>> On 12 Oct 2020, at 15:36, Don Lindsay via Webobjects-dev
>> <email@hidden <mailto:email@hidden>>
>> wrote:
>>
>> Hello, I apologize if this is a duplicate, I recently re-subscribed because
>> my old Mac.com <http://mac.com/> email address appears to intermittently
>> reject messages;
>>
>> I want to apply a qualifier to an ERXDisplayGroup that is defined in WOO. I
>> couldn’t figure out how to create a EOFetchSpecification with a qualifier in
>> EOModeler that would take a value from the user’s session. The qualifier
>> takes it’s value from a variable in the user’s session using a method in the
>> component class.
>>
>> My ERXDisplayGroup is defined like this:
>>
>> {
>> "WebObjects Release" = "WebObjects 5.0";
>> variables = {
>> databaseDetailsDisplayGroup = {
>> class = ERXDisplayGroup;
>> dataSource = {
>> class = EODatabaseDataSource;
>> editingContext = "session.defaultEditingContext";
>> fetchSpecification = {
>> class = EOFetchSpecification;
>> entityName = Databasedetails;
>> fetchLimit = 0;
>> isDeep = YES;
>> };
>> };
>> fetchesOnLoad = YES;
>> formatForLikeQualifier = "%@*";
>> numberOfObjectsPerBatch = 10;
>> selectsFirstObjectAfterFetch = YES;
>> sortOrdering = ({class = EOSortOrdering; key = name;
>> selectorName = "compareAscending:"; });
>> };
>> };
>> }
>>
>> In my component I have
>>
>> public NSArray<EOGenericRecord> getConnectorEntries() {
>> databaseDetailsDisplayGroup.setQualifier(tenantSpec().qualifier());
>> return databaseDetailsDisplayGroup.filteredObjects();
>> }
>> public EOFetchSpecification tenantSpec() {
>> return ((Session)session()).tenantFetchSpecification();
>> }
>>
>> Session:
>>
>> public EOFetchSpecification tenantFetchSpecification() {
>> EOFetchSpecification fetchSpecification = new EOFetchSpecification();
>> fetchSpecification.setQualifier(new
>> EOKeyValueQualifier("tenant",EOQualifier.QualifierOperatorEqual,this.tenant));
>> return fetchSpecification;
>> }
>>
>>
>> And in my WOD I have
>>
>> RowRepetition: WORepetition {
>> list = connectorEntries;
>> item = currentItem;
>> }
>>
>> The data never gets filtered by the Qualifier, it returns all objects with
>> no filtering.
>>
>> What have I done wrong here, am I going at this the wrong way?
>>
>> Thanks in Advance
>>
>> Don
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden
>> <mailto:email@hidden>)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden