non-linear worepetition
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.