Re: binding trouble
Re: binding trouble
- Subject: Re: binding trouble
- From: Chuck Hill <email@hidden>
- Date: Mon, 27 Jun 2005 12:23:12 -0700
You could look at OGNL (wrapped by WOOgnl in Project Wonder). It
allows you to pass parameters in bindings.
Chuck
On Jun 27, 2005, at 12:02 PM, Amedeo Mantica wrote:
Yes Arturo, but doing this I need a Java method for each image...
I'm trying to do it in an unique Java method, but I need to pass it
the variable.
Amedeo
On 27/giu/05, at 20:55, Arturo Perez wrote:
Hi Amedeo,
You bind to a Java method
public String imgPath() {
return "myPath" + filename;
}
No where did I say you bind to what you wrote. I said to set the
binding as David suggested.
Do the above then reread my email.
Amedeo Mantica wrote:
thanks Arturo, but this binding in not permitted:
"myPath" + filename
Amedeo
On 25/giu/05, at 16:11, Arturo Pérez wrote:
Dunno if anyone else answered this.
You have a repetition with a list binding and an item binding.
Call the item binding filename.
For you image use the src binding as David says. WORepetition
will make sure that the filename is the one used for that
particular loop of the repetition. Here's an example.
Loop one
filename set to "britneyspears.jpg"
create WOimage
bind filename to imgSrc => "myPath" + filename =>
myPath/ britneyspears.jpg
Loop two
filename set to "halleberry.jpg"
create WOimage
bind filename to imgSrc => "myPath" + filename =>
myPath/ halleberry.jpg
Loop three ...
See, the repetition takes care of making sure that value of the
bind variable for the nested content (as they say in Struts-
land) is correct. But it also does it on form submit so that
if you had a link next to each image, when the link is clicked
the filename binding will be set to the value used to generate
the link.
HTH
-arturo
On Jun 24, 2005, at 11:24 AM, Amedeo Mantica wrote:
thanks David, but this works fine If i have only an image in
my item object, but i have more images, so i need to pass to
the function the image name...
for example, following your example:
public String imgSrc(String aFileName) {
return "myPath" + aFileName;
}
and bind the WOImage to imgSrc(listItem.theFileName())
But this won't work...
Any help?
Thanks
Amedeo
On 24/giu/05, at 17:06, David LeBer wrote:
On 24-Jun-05, at 10:57 AM, Amedeo Mantica wrote:
Hi
This is my problem...
I have a WORepetition...
the list item is an object containing a some stringa,
strings are image names.
I need to display the images using WOImage, but I need to
prepend a path to the image name.
I tried to make a binding line "myPath"+theFileName, but is
not accepted...
can I bind the WOImage src to a function thet return the
String path?
How to pass theFileName to that function?
public String imgSrc() {
return "myPath" + listItem.theFileName();
}
Bind this to the WOImage src binding.
;david
--
David LeBer
Codebase Software Systems
site: http://www.codebase.ca
blog: http://david.codebase.ca
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40ethicist.net
This email sent to 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:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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