On May 16, 2011, at 10:00 AM, [email protected] wrote:
> So what about this ? including a variable in a url :
>> in WOD
>> picture : WOImage {
>> src = "http://webserver/person/mini/"${^person.id}".jpg";
>> }
Quick and dirty, lots of assumptions, top of my head, might not compile,
non-Wonder solution follows. But, really, use Wonder. Even its implementation
of acquiring the pk has a lot of advantages over the old busted impl in
EOUtilities.
picture : WOImage {
src = urlForImage;
}
Component's java class:
public String urlForImage() {
Object primaryKey =
EOUtilities.primaryKeyForObject(person.editingContext(),
person).valueForKey("id");
return "http://webserver/person/mini/" + String.valueOf(primaryKey) +
".jpg";
}
ERAttachment makes stuff like this really easy. It's in Wonder:
http://www.wocommunity.org/podcasts/WOWODC09E-PracticalWonder.mov
tb
_______________________________________________
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]