• 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: D2W: Selectors for enum types?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: D2W: Selectors for enum types?


  • Subject: Re: D2W: Selectors for enum types?
  • From: Paul Hoadley <email@hidden>
  • Date: Wed, 30 May 2012 18:29:08 +0930

Hi Ramsey,

On 30/05/2012, at 10:06 AM, Ramsey Gurley wrote:

It shouldn't have made it to the dataSource() method. You should log what rules are firing for restrictedChoiceKey.  Open your log4j page and set up a d2w rule logger for that key. See what the console tells you when you load the page.

Ah, OK, this is subtle.  As I mentioned, this is an attribute I'm adding to the model at runtime (Organisation.billingStatus).  As such, the Organisation class knows nothing about it, and I don't get the opportunity to set a default value.  So when the page calls object.billingStatus.allValues to get the values for the drop-down, it gets a null at billingStatus.  Adding this third line works:

            EditPageInterface epi = D2W.factory().editPageForNewObjectWithEntityNamed(Organisation.ENTITY_NAME, session());
            epi.setNextPage(session().context().page());
            ((ERMODWizardCreationPage) epi).object().takeValueForKey(BillingStatus.Billed, "billingStatus");

But obviously that's going to be brittle—casting the EditPageInterface to an ERMODWizardCreationPage.  (I don't see myself changing looks any time soon, so it will work indefinitely, but it's still ugly.)  Got any better ideas?


-- 
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

  • Follow-Ups:
    • Re: D2W: Selectors for enum types?
      • From: Ramsey Gurley <email@hidden>
References: 
 >D2W: Selectors for enum types? (From: Paul Hoadley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Ramsey Gurley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Paul Hoadley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Ramsey Gurley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Paul Hoadley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Ramsey Gurley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Paul Hoadley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Ramsey Gurley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Paul Hoadley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Ramsey Gurley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Paul Hoadley <email@hidden>)
 >Re: D2W: Selectors for enum types? (From: Ramsey Gurley <email@hidden>)

  • Prev by Date: Re: ERJaveMail
  • Next by Date: Re: ERJaveMail
  • Previous by thread: Re: D2W: Selectors for enum types?
  • Next by thread: Re: D2W: Selectors for enum types?
  • Index(es):
    • Date
    • Thread