Re: rawRowsForSQL and WORepetition
Re: rawRowsForSQL and WORepetition
- Subject: Re: rawRowsForSQL and WORepetition
- From: Sam Barnum <email@hidden>
- Date: Thu, 22 Apr 2004 16:11:40 -0700
Maybe I'm missing the question, but you should just be able to bind
directly to the column name
WORepetition bindings list=list, item=row
WOString value = row.code
WOString2 value = row.name
This calls valueForKey() on the row NSDictionary, which in turn returns
the correct value.
On Apr 22, 2004, at 12:17 PM, Arturo Perez wrote:
Michael Engelhart wrote:
Hi -
I'm converting some JDBC/Servlet code over to WO for testing purposes
and have a question.
We can vanquish the Dark Overlord one hamlet at a time :-)
I need to use rawRowsForSQL (at least I think I do) for a query that
looks like this when viewed as a PreparedStatement in regular JDBC
code:
"SELECT code, name FROM countries WHERE code IN (SELECT DISTINCT
country FROM hotels) AND name LIKE ? ORDER BY name"
If this table is small enough and read-only enough it may be worth
putting into an application-level cache. (It's a checkbox in EOModel
to do so).
I know that rawRowsForSQL returns an NSArray of NSDictionary. What
I can't figure out is how to display this simple 2 column table.
I'm assuming that you used WOBuilder to create the table and that you
specified "Wrap second row in WORepetition". I further assume that
your repetition has the array as its list and the countryDictionary as
its item and that you've bound column1 to countryDictionary.name and
column2 to countryDictionary.code or some such.
I can display it by connecting it to WOString's in each table cell
but can't seem to break it out using NSDictionary.objectForKey or
something like that.
What do you mean by break it out? Are you trying to get access to one
of the columns using objectForKey? You could try
countryDictionary.valueForKey("code") because that's what WO does.
-arturo
_______________________________________________
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.
_______________________________________________
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.