• 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
non-linear worepetition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

non-linear worepetition


  • Subject: non-linear worepetition
  • From: Michael Engelhart <email@hidden>
  • Date: Fri, 13 Aug 2004 09:36:23 -0500

I have a confusing problem from a "how do I do this in WebObjects" perspective.

I have a grid (i.e. table) of objects that is backed by a MultiHashMap data structure which is a Jakarta commons collection object that is in essence a map of maps.
The first column is a key to another Map which stores the key/values for the rest of the columns in that row. So I loop through the row1 keyset and then call a Map.get(key) to access the object for each column. The columns can be also empty so I have to call each key individually since the order of the columns is relevant.


Essentially there are 2 loops (pseudo-code follows):

for key in row_map:
column_map = row_map(key)
for key in column_map:
object = column_map(key)

The reason for this complex datatype situation for a table is that the data I'm using is returned as a simple single dimensioned NSArray that I need to order down the first column by a key and across each column by a different key and the keys aren't something that can be sorted like you would a number or alphabetic sort. They're just a convention as to how the data should be displayed and as I said there can be missing data points in that row so I can't simple iterate through the keys.


So my question is how to best generate a WOHyperlink in each cell that points to the object that is referenced by that cells key. I came up with a very JSP - like solution that gets the hyperlink generated which calls a cover method to return an html string that I place in that cell but it's really cumbersome and is hard to maintain. Also this requires (i think ) that I put parameters into the url of the WOHyperlink and then point that to a direct action which I'd also rather not do. It seems like there should be some way for me to create a WOHyperlink that calls an action that just "knows" which object was clicked but because it's not a simple indexed array I'm a bit confused as to how to do this.


Thanks,

Mike
_______________________________________________
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.


  • Follow-Ups:
    • Re: non-linear worepetition
      • From: "Arturo Perez" <email@hidden>
  • Prev by Date: Re: web objects and interface builder working together
  • Next by Date: Xcode 1.5 and SVN
  • Previous by thread: Re: More EOModeler Insanity (and another issue)
  • Next by thread: Re: non-linear worepetition
  • Index(es):
    • Date
    • Thread