Re: How do I initialize an Entity attribute upon creation in D2W?
Re: How do I initialize an Entity attribute upon creation in D2W?
- Subject: Re: How do I initialize an Entity attribute upon creation in D2W?
- From: David LeBer <email@hidden>
- Date: Sat, 05 Nov 2011 13:06:48 -0400
On 2011-11-05, at 12:23 PM, James Cicenia wrote:
> The subject line is the question.
>
> I use the standard factory:
>
> public WOComponent newObjectForEntityName(String entityName) {
> WOComponent nextPage = null;
> try {
> EditPageInterface epi = D2W.factory().editPageForNewObjectWithEntityNamed(entityName, session());
> epi.setNextPage(session().context().page());
> nextPage = (WOComponent) epi;
> } catch (IllegalArgumentException e) {
> ErrorPageInterface epf = D2W.factory().errorPage(session());
> epf.setMessage(e.toString());
> epf.setNextPage(session().context().page());
> nextPage = (WOComponent) epf;
>
> }
> return nextPage;
> }
Same way you should for non D2W, in the EO's awakeFromInsertion();
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
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