• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: trouble with ERXBatchingDisplayGroup [SOLVED But i suggest reading]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trouble with ERXBatchingDisplayGroup [SOLVED But i suggest reading]


  • Subject: Re: trouble with ERXBatchingDisplayGroup [SOLVED But i suggest reading]
  • From: Amedeo Mantica <email@hidden>
  • Date: Thu, 13 Jan 2011 20:11:27 +0100

Hello JW, AK and everybody

Scenario:

CFAzienda entity

CFAzienda have some attributes and some relationships
actually we need to discuss abuout relationships

i have two entities

CFSettore
CFServizio

the relationships map is

CFAzienda <<----> CFSettore ( relationship name is "settore" )
CFAzienda <<---->> CFServizio ( relationship name is "serviziOfferti" )


Now I have to display the CFAzienda in a DisplayGroup and i have two popup menus for filtering the group

one popup menu have a list of CFSettore and the other a list of CFServizio


as usual I was using this method:

.
.
EODatabaseDataSource ds = ((Session)session()).getAziendeController().dataSource();
displayGroup.setDataSource(ds);
.
.

public void setQualifiers() {
NSMutableDictionary<String, EOGenericRecord> dict = new NSMutableDictionary<String, EOGenericRecord>();
dict.takeValueForKey(true,"isEnabled");


if( selectedSettore!=null ) {
dict.takeValueForKey(selectedSettore, "settore");
}


if( selectedServizio!=null ) {
dict.takeValueForKey(selectedServizio, "serviziOfferti");
}


EOQualifier q = EOQualifier.qualifierToMatchAllValues(dict.immutableClone());
displayGroup.setQualifier(q);
displayGroup.updateDisplayedObjects();
}


And this works file if the display group is an ERXBatchingDisplayGroup

but today for some reasons i discovered that the but ERXBatchingDisplayGroup ( due to the nature of batching ) have the filteredObject() returning a ERXBatchingDisplayGroup.fakeArray instead on an NSArray of objects, so I decided to use the ERXDisplayGroup instead


now the problem:

the  CFservizio qualifier doesn't work anymore, or better, no data is displayed at all, practically this

if( selectedServizio!=null ) {
dict.takeValueForKey(selectedServizio, "serviziOfferti");
}

is not working, remember that the relationship "serviziOfferti" is a to many.


After some testing and looking at both ERXDisplayGroup and the ERXBatchingDisplayGroup source code, I realized that the problem is how ERXDisplayGroup fetch data, then I decided to do filtering directly in the DataSource...


public void setQualifiers() {
NSMutableDictionary<String, EOGenericRecord> dict = new NSMutableDictionary<String, EOGenericRecord>();
dict.takeValueForKey(true,"isEnabled");


if( selectedSettore!=null ) {
dict.takeValueForKey(selectedSettore, "settore");
}


if( selectedServizio!=null ) {
dict.takeValueForKey(selectedServizio, "serviziOfferti");
}


EOQualifier q = EOQualifier.qualifierToMatchAllValues(dict.immutableClone());
ds.setAuxiliaryQualifier(q); //ds IS THE DATA SOURCE

displayGroup = new ERXDisplayGroup<CFAzienda>();
displayGroup.setSortOrderings(nameOrdering.immutableClone());
displayGroup.setDataSource(ds);
displayGroup.fetch();
}



This is working, but requires to destroy and refetch the displaygroup everytime.
That's all

Any comment ?

Regards
Amedeo


On 13/gen/2011, at 18.04, Johann Werner wrote:

Hi Amedeo,

perhaps you could post the code you use to create the display group and set its qualifiers, so we can have a look at?

jw

Am 13.01.2011 um 16:53 schrieb Amedeo Mantica:

I have an ERXBatchingDisplayGroup that is working fine, but just today calling the method filteredObject I discovered that the ERXBatchingDisplayGroup will not return a real NSArray of objects but instead a special ERXBatchingDisplayGroup.fakeArray that is not suitable for me.

So due to the fact that the datasource is small i decided to give up batching and basically use the simpler ERXDisplayGroup, simply replacing "ERXBatchingDisplayGroup" with "ERXDisplayGroup", but now the displaygroup won't set qualifiers anymore.

Any reason ?

Thanks

Regards
Amedeo



 _______________________________________________
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

References: 
 >trouble with ERXBatchingDisplayGroup (From: Amedeo Mantica <email@hidden>)
 >Re: trouble with ERXBatchingDisplayGroup (From: Johann Werner <email@hidden>)

  • Prev by Date: Re: trouble with ERXBatchingDisplayGroup
  • Next by Date: Re: 2010 vids
  • Previous by thread: Re: trouble with ERXBatchingDisplayGroup
  • Next by thread: Non class properties
  • Index(es):
    • Date
    • Thread