Re: Hashtable to WOString?
Re: Hashtable to WOString?
- Subject: Re: Hashtable to WOString?
- From: Nathan Dumar <email@hidden>
- Date: Sat, 23 Oct 2004 15:25:55 -0400
David,
I just tried your suggestion, and received a KVC error, which makes
sense. Hashtable doesn't implement KVC. That's okay, though. I'm
going to go back and change the original construction of the Hashtable
to make an NSDictionary instead. Though slower, it's easier to use in
WO.
Thanks,
Nathan
On Oct 23, 2004, at 5:36 AM, David Teran wrote:
Well, did you try this:
aString: WOString {
value = myHashtable.keyName;
}
afaik this should work.
regards David
Am 23.10.2004 um 00:20 schrieb Nathan Dumar:
Aha! Number 2 is what I was hoping to hear. Thanks Colin!
Nathan
On Oct 22, 2004, at 6:00 PM, Colin Clark wrote:
Hi Nathan,
You're right, you can't pass arguments in WOComponent bindings, so
your first approach won't work. For any object that implements
Key-Value Coding, you could simply bind up the key name, such as
with an NSDictionary (eg. myDictionary.keyName). However, Hashtable
doesn't speak KVC, so there are a couple of other options:
1. Write an accessor in your WOComponent for that key of the
Hashtable:
public String getValueFromHashtable {
return myHashtable.get("keyName");
}
2. Convert your Hashtable into an NSDictionary. There's a
constructor available for that.
NSDictionary myDictionary = new NSDictionary(myHashtable);
I hope that helps,
Colin
On Friday, October 22, 2004, at 05:30 PM, Nathan Dumar wrote:
Is there an easy way of getting some text out of a Hashtable and
into a WOString? I thought that I could set the binding in
WOBuilder to aHashtable.get("key"), but that does not work.
If there's no simple way, then I'll just right a method to return
the String value.
Thank you,
Nathan
_______________________________________________
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
---
Colin Clark
Dynamic Web and Database Development Lead,
Resource Centre for Academic Technology,
University of Toronto
_______________________________________________
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