Getting attribute-level userInfo at run-time
Getting attribute-level userInfo at run-time
- Subject: Getting attribute-level userInfo at run-time
- From: Paul Hoadley <email@hidden>
- Date: Thu, 22 Oct 2009 18:25:31 +1030
Hello,
I have an EO which contains a number of boolean attributes which I am
going to treat as a group in the view layer. They might not be the
only boolean attributes in the entity, and I don't want to hard-code
their names, because I may add or subtract from the set in the model
later, and it would be neat if I didn't then have to change the EO
class. So I've annotated the attributes with userInfo. Now I have
some questions:
1. How can I nominate in the userInfo dictionary that the value for a
key is a boolean literal? Entity Modeler kept flipping back to
String, so I have added this to all the relevant attributes by hand:
userInfo = {comorbidity = true; };
Is that sufficient, or is that just going to return the String value
"true"? (If so, fine. But if there's a way to express a boolean
literal, that would be nice.)
2. What's the easiest way to get at this information inside my EO
(ERXGenericRecord sub-)class? I can't see an easy path to an EO's
EOAttributes. Do I need to retrieve the EOModel, and if so, is there
a more direct way to retrieve _that_ (from an EO class) than via
ERXModelGroup.defaultGroup().modelNamed(), which I assume would
require that I hard-code the model name into this class, wouldn't it?
In short, I can see what looks like the long way to getting what I
want, I'd just like to know if there are any better ways.
--
Paul Hoadley
http://logicsquad.net/
_______________________________________________
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