• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: binding trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binding trouble


  • Subject: Re: binding trouble
  • From: Arturo PĂ©rez <email@hidden>
  • Date: Sat, 25 Jun 2005 10:11:11 -0400

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:
email@hidden


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: This email sent to email@hidden
References: 
 >binding trouble (From: Amedeo Mantica <email@hidden>)
 >Re: binding trouble (From: David LeBer <email@hidden>)
 >Re: binding trouble (From: Amedeo Mantica <email@hidden>)

  • Prev by Date: Re: R-R Loop Oddities
  • Next by Date: Re: R-R Loop Oddities
  • Previous by thread: Re: binding trouble
  • Next by thread: Re: binding trouble
  • Index(es):
    • Date
    • Thread