• 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: Linking Array elements to WOComponents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking Array elements to WOComponents


  • Subject: Re: Linking Array elements to WOComponents
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 22 Mar 2005 11:53:19 -0800

You can make bindings like that using OGNL or WOOgnl (from Project Wonder). You can, but I don't think you should. I feel compelled to comment on the awfulness of keeping data in an array like this. It is _not_ an ordered set of data that you have. Hence it does _not_ belong in an array. Having the meaning of an array element be implied by position in the array is just plain awful. Too awful to contemplate and too awful for WO to have built in support for it. That is why it is not simple, it ought not be. Use a dictionary where the meaning is given by the keys rather than implied. Or use a real object.


Chuck


On Mar 22, 2005, at 11:45 AM, Sacha Mallais wrote:

On Mar 22, 2005, at 11:26 am, Jeffrey Schmitz wrote:

So what is it that you then map to your WO componenet? i.e. what do you put in your wod file for each of the WOString elements?

I guess I'm surprised the wod files don't handle this better and let you put something like (I don't have the syntax of the wod files quite memorized):

...
MyString3 : WOString
  value = myStrings[2];
end

MyString4 : WOString
  value = myStrings[3];
end
...

Seems like it would be a simple and very useful thing to be able to do. I was thinking there must be something I'm missing, or some special syntax that I just didn't know, but sounds like there's no straightforward solution to what I thought would be a very simple problem.

It probably wouldn't be too hard to override valueForKey to accept such bindings...


sacha



--
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


  • Follow-Ups:
    • Re: Linking Array elements to WOComponents
      • From: Jeffrey Schmitz <email@hidden>
References: 
 >Linking Array elements to WOComponents (From: Jeffrey Schmitz <email@hidden>)
 >Re: Linking Array elements to WOComponents (From: David LeBer <email@hidden>)
 >Re: Linking Array elements to WOComponents (From: Arturo Perez <email@hidden>)
 >Re: Linking Array elements to WOComponents (From: Jeffrey Schmitz <email@hidden>)
 >Re: Linking Array elements to WOComponents (From: Sacha Mallais <email@hidden>)

  • Prev by Date: Re: Linking Array elements to WOComponents
  • Next by Date: Re: ANY DB2 Experts Here????
  • Previous by thread: Re: Linking Array elements to WOComponents
  • Next by thread: Re: Linking Array elements to WOComponents
  • Index(es):
    • Date
    • Thread