Here is the Code:
import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;
public class editAgent extends
com.psgs.dodig.dwtm.AbstractSubComponent {
/** @TypeInfo Agents */
public Agents agent;
public WOComponent oReferringPage;
// This WODisplayGroup is initialized from the .woo archive in
the component's constructor method
public editAgent(WOContext context) {
super(context);
}
public void setThisPerson(Agents oAgents)
{
this.agent = oAgents;
}
public WOComponent returnToPage()
{
return oReferringPage;
}
public void setCallingPage(WOComponent oPage)
{
oReferringPage = oPage;
}
}
Here is the To Many properties
ToManyRelationship: WOToManyRelationship {
sourceEntityName = "Agents";
sourceObject = agent;
relationshipKey = "mgtOfc";
destinationDisplayKey = "orgs.description";
}
Thanks,
Don
On Dec 9, 2007, at 4:44 AM, Lachlan Deck wrote:
Hi Don,
On 09/12/2007, at 7:44 PM, Don Lindsay wrote:
Agents is a single row.
Yes, but is the signature of the method referred to by the key
'agent' returning an NSArray or Agent?
i.e., is it:
public NSArray agent() {...} // wrong
or
public Agent agent() {...} // correct
Just to clarify, can you paste in the code from your java component?
mgtOfc is a relationship key. Even when I do:
sourceObject: agent
sourceEntityName: "agents"
That's an unusual entity name. i.e., any entity name (normally)
starts with an uppercase char (like your Java classes). e.g.,
"Agent". (the external name for the entity can be lowercase of
course and can be a completely different name if need be).
relationshipKey: "mgtOfc"
destinationDisplayKey = "orgs.name"
The listbox does not show on the screen when the screen is
rendered in the application.
Sorry for being so dense.
No worries... we'll get there. We just need to clarify exactly what
you're doing.
On Dec 8, 2007, at 10:29 PM, Lachlan Deck wrote:
On 09/12/2007, at 12:16 PM, Don Lindsay wrote:
I want to use a WOToManyRelationship control.
I put in the following
datasource:
sourceObject: agents
sourceEntityName: "Agents"
relationshipkey: "mgtOfc"
sourceObject should be bound to a key that returns an
EOEnterpriseObject not an array of objects.
is "mgt0fc" a toMany relationship?
When I do this the wo relationship does not even display in the
form.
I put in the following
datasource:
sourceObject: agents.mgtOfc
Again, if "agents" is an array, then agents.mgtOfc is going to
return an array containing the results of performing mgt0fc on
each agent in agents. If agents is badly named and does indeed
return an EOEnterpriseObject (and not one within an array) then
agents.mgt0fc looks like it would be an array rather than a
single object.
You should have something like:
sourceObject = myAgent;
sourceEntityName = "Agent";
relationshipKey = managedOrgAssociations;
destinationDisplayKey = "organization.name";
Check out the api for WOJExtensions:
developer.apple.com/documentation/WebObjects/Reference/
WOJExtensions/index.html
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/pccdonl%
40mac.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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]