• 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: Type casting in WOComponents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Type casting in WOComponents


  • Subject: Re: Type casting in WOComponents
  • From: Guido Neitzer <email@hidden>
  • Date: Thu, 7 Jun 2007 09:51:58 -0600

On 07.06.2007, at 08:30, Aaron Thompson wrote:

Forgive me if this is a really obvious answer, but what do you mean by "the key"? If phone is a property of Administrator but not User, and in my component I have a WOString with value = user.phone, it gives an error.

Na, if you have an EOGenericRecord (and all your objects might be subclasses of that), you can just type "user.phone" it uses it. If you don't have a phone attribute, you might want to surround that part with a conditional that checks against a boolean on the EO like


<wo:if condition="user.isAdministrator">
	<wo:textfield value="phone" />
</wo:if>

Or, you could have an edit page, that is generic in the way, that it assumes it has an EOGenericRecord, has save, cancel and whatever methods are generic and then create subclass and only re-implement the HTML. Or use D2W ... ;-) okay, just kidding.

Otherwise, as Chuck kinda pointed out, it might be easiest to create separate edit pages and not fight it.

Maybe yes. We have some generic pages (or components) for editing and listing objects, and subclass from them for specific pages and behaviour.


cug


_______________________________________________ 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: 
 >Type casting in WOComponents (From: Aaron Thompson <email@hidden>)
 >Re: Type casting in WOComponents (From: Guido Neitzer <email@hidden>)
 >Re: Type casting in WOComponents (From: Aaron Thompson <email@hidden>)

  • Prev by Date: Re: URGENT!!! Downgrade WebObjects 5.3.* to 5.2.4 as well Java 1.5.* to 1.4.2_09
  • Next by Date: Re: Type casting in WOComponents
  • Previous by thread: Re: Type casting in WOComponents
  • Next by thread: Re: Type casting in WOComponents
  • Index(es):
    • Date
    • Thread