RE: DisplayGroup setMasterObject() and queryMatch (Solved)
RE: DisplayGroup setMasterObject() and queryMatch (Solved)
- Subject: RE: DisplayGroup setMasterObject() and queryMatch (Solved)
- From: "Paul Mathews" <email@hidden>
- Date: Fri, 13 May 2005 16:03:43 +1000
- Organization: Cubespace Pty Ltd
Hi All
The only way around this I have found is to set up an EOQualifier and add if
to a fetch spec. The members are filtered by the qualifier and the
queryMatch operators on the page work as well. Her is some demo code...
This does not work...
Session s = (Session) session();
Department d = s.getDepartment();
contactDisplayGroup.setMasterObject( d );
Well when I say it does not work, well it does for the initial fetch, but
all of the querymatch fields on the page stop working. I tried it out again
with a plain Display Group Component. All works as expected (well) until you
change the display group to have a detail data source and set the master
object to be something...
I am fairly new to wo, but I would of thought this would/should work, anyway
This does work however...
Session s = (Session) session();
Department d = s.getDepartment();
Number n = d.departmentid();
String whereclause =
"(contact_departments.departments.departmentid = " + n + ")";
EOQualifier eoq = EOQualifier.qualifierWithQualifierFormat(
whereclause, null );
EOModelGroup mg = EOModelGroup.defaultGroup();
EOFetchSpecification fs = mg.fetchSpecificationNamed(
"contactForDepartment", "Contact" );
fs.setQualifier( eoq );
EODatabaseDataSource ds = new
EODatabaseDataSource(s.defaultEditingContext(), "Contact", "contactForOrg"
);
contactDisplayGroup.setDataSource( ds );
The qualifier does the same job as the setMasterObject() was doing but
everything else work just the same as well.
>Hi All
>
>I just finished a contact search/add/edit page for our departments which
uses a displayGroup - contactsDisplayGroup.
>
>All was well until... the last thing I added was to make the display group
have a "detailed data source" with the Master Entity of departments and the
>relationship "contacts" (which is many-to-many).
>
>When I do this the queryMatch fields fail to function and the search/filter
mechanisms stop working?
>
>Should this the case, or is there something I missed?
>
Paul Mathews
---------------------------------------------
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