Re: Velocity Template Question

2009-11-21 Thread Andrew Lindesay
Hi; Thanks for that -- works really well. cheers. ___ Andrew Lindesay www.lindesay.co.nz ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your

Re: Velocity Template Question

2009-11-21 Thread Faizel Dakri
I'm assuming that the 'code' is an EO attribute of an entity. I think you'll have to iterate over the list of attributes, check the name and set a flag manually. Then you can conditionally generate your template code base on the flag. I may be wrong--and I'd love to find an easier way if I am-

Re: Velocity Template Question

2009-11-20 Thread Mike Schrag
containsObject is an NSArray method, but these objects are actually Entity Modeler's non-WO versions of the EO classes, which are java.util.List/java.util.Set, so if it has any chance of working you will need to use contains instead containsObject. I've never really tried to do this, though, an

Re: Velocity Template Question

2009-11-20 Thread Andrew Lindesay
Hi Mike; You are right; I'm trying to add a method to the entitys' superclasses for fetching based on "code" if the "code" attribute is present. I'm trying to achieve what I had before using velocity. I am doing something like this, but the #if is not firing; > #if ($entity.sortedClassAttrib

Re: Velocity Template Question

2009-11-20 Thread Mike Schrag
i'm not exactly sure what you're trying to do ... are you trying to lookup an attribute named "code" and then ask if the given entity contains that attribute, then you render whatever is in the #if? Maybe i should ask you what you're attempting to achieve. On Nov 20, 2009, at 3:17 PM, Andrew L

Re: Velocity Template Question

2009-11-20 Thread Andrew Lindesay
Hi Mike; >> #if ($entity.sortedClassAttributes.containsObject(code)) > ... > and "contains" -- it's a List (maybe a Set). and you would have to have > looked up the attribute "code" already, obviously. Sorry; I'm a bit new to this -- can you elaborate on that? cheers. ___ Andrew Lindesay www.

Re: Velocity Template Question

2009-11-20 Thread Mike Schrag
>>> #if ($entity.sortedClassAttributes.code) > >>> #if ($entity.sortedClassAttributes().containsObject(code)) > > or > >>> #if ($entity.sortedClassAttributes.containsObject(code)) and "contains" -- it's a List (maybe a Set). and you would have to have looked up the attribute "code" already, obv

Re: Velocity Template Question

2009-11-19 Thread Chuck Hill
On Nov 19, 2009, at 8:52 PM, Andrew Lindesay wrote: Hello; In eo-gen templates, is it possible to do something like this; #if ($entity.sortedClassAttributes.code) #if ($entity.sortedClassAttributes().containsObject(code)) or #if ($entity.sortedClassAttributes.containsObject(code))