Re: Newbie needs help with Pet Store example - WOImage binding
Re: Newbie needs help with Pet Store example - WOImage binding
- Subject: Re: Newbie needs help with Pet Store example - WOImage binding
- From: Kaj Hejer <email@hidden>
- Date: Fri, 25 Apr 2003 08:47:17 +0200
At 22:32 -0400 24-04-2003, Helen Deasy wrote:
All,
I'm trying to learn how to add a dynamic image to a WORepetition and
the WO Pet Store has a good example of what I'm looking for. Problem
I'm having is I can't figure out the binding for the WOImage - which is:
Image1: WOImage {
filename = currentProduct.imageName;
framework = "app";
key = currentProduct.imageName;
mimeType = "image/gif";
}
Hi!
The secret is in
Examples/JavaWebObjects/Frameworks/PetStoreWOModel/Product.java
If you check the framework section of PetStoreWOJava you will see
that it use a framework called PetStoreWOModel. This framework
contains the eomodel and the classes for the eoobject like
Product.java.
Product.java contains the following method:
public String imageName(){
if(imageName==null){
StringTokenizer st = new StringTokenizer(descn(),">",false);
if(st.countTokens()>0){
String s=st.nextToken();
imageName = s.substring(s.lastIndexOf("/")+1,
s.lastIndexOf("\""));
}
}
return imageName;
}
-Kaj :)
_______________________________________________
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.