Re: calling business logic on items from a displayGroup
Re: calling business logic on items from a displayGroup
- Subject: Re: calling business logic on items from a displayGroup
- From: "Jonathan Fleming" <email@hidden>
- Date: Mon, 15 Sep 2003 17:01:25 +0100
Adam
If you make your TeamMember entity a custom Java class (click the java icon
in EOModel or Property>Generate Java Files...) you can access code such as
this which would be place in your TeamMember custom class:
public String fullname() {
String first = firstName();
String last = lastName();
String full;
if ((first != null) && (! (first.equals("")))) {
full = last + ", " + first;
}
else {
full = last;
}
return full;
}
you'll be able to bind your popup to
list -- aListOf_FullNames // where this is your array of names however you
do it (firsName + " "+ LastName)
name -- "fullName" // don't know if you'll need to set this
selection -- teamMember.fullName // where teamMember is a type of the Class
TeamMember
Hope that helps you in the right direction.
Jonathan :^)
From: "Adam Chan" <email@hidden>
To: <email@hidden>
Subject: Re: calling business logic on items from a displayGroup
Date: Mon, 15 Sep 2003 09:45:59 -0600
Don't quite get how your EOModeld is set. Isn't EOEnterpriseObject is an
Interface, not a Class? (don't even know which version of WebObjects are
you
talking about) If you want something generic, shouldn't you use the
EOGenericRecord?
Any way, the easiest way to get full name out of first name and last name
is
to set up a derived attribute in the EOModeld.
----- Original Message -----
From: "Mark W. Shead" <email@hidden>
To: <email@hidden>
Sent: Sunday, September 14, 2003 1:43 PM
Subject: calling business logic on items from a displayGroup
> I am using WOPopUpButton to show a list of names in a form. I would
> like to show the full name instead of just the last. The object type
> is TeamMember. The item attribute of WOPopUpButton is bound to a
> variable called teamMember of type EOEnterpriseObject. The list
> attribute is bound to teamMembersDisplayGroup.displayedObjects.
>
> The displayGroup uses EOEnterpriseObjects instead of TeamMember
> objects. However my method to return the full name (getFullName()) is
> in the object of type TeamMember and I can't access the customized
> methods when it is cast as an EOEnterpriseObject.
>
> Is there anyway I can cast TeamMember object to it's customized type
> when building the WOPopUpButton so I can call the customized methods on
> it? I know how to accomplish what I'm after if I don't use display
> groups, so if it is possible I'm using them in a way that they aren't
> meant to be used.
>
> Thanks in advance for any suggestions or guidance!
>
> Mark
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_________________________________________________________________
Express yourself with cool emoticons - download MSN Messenger today!
http://www.msn.co.uk/messenger
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.