• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Need to find an attributes width.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need to find an attributes width.


  • Subject: Re: Need to find an attributes width.
  • From: Sacha Mallais <email@hidden>
  • Date: Fri, 8 Apr 2005 10:14:59 -0700

On Apr 8, 2005, at 9:33 am, James Cicenia wrote:

I am a bit confused on how I can get the attributes width.

I have a component which I pass a generic EOEnterpriseObject to. Since, this
component only affects certain objects which all contain an attribute called "name",
I need to find the maximum defined width.


However I couldn't seem to find in the api the place where I can get an attribute
from a string, i.e, "name" of that enterprise object.


Hi James,

All that stuff is held in the model classes: EOEntity, EOAttribute, EORelationship...

First you need to get an EOEntity for your eo. Simplest would be to use the method in com.webobjects.eoaccess.EOUtilities:
myEntity = EOUtilities.entityForObject(myEditingContext, myEO);


Then, it is a simple matter to get the EOAttribute:
myAttribute = myEntity.attributeNamed("name");

And finally, the width:
width = myAttribute.width();


HTH!


sacha


-- Sacha Michel Mallais - 400 lb. chimp Global Village Consulting Inc.: http://www.global-village.net/ 1. Never tell everything at once. -- Ken Venturi, Ken Venturi's Two Great Rules of Life

_______________________________________________
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


References: 
 >Need to find an attributes width. (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: WO/Tiger
  • Next by Date: Best Practice on Uncommitted Changes in EC
  • Previous by thread: Need to find an attributes width.
  • Next by thread: Best Practice on Uncommitted Changes in EC
  • Index(es):
    • Date
    • Thread