• 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
d2wContext in non-d2w components
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

d2wContext in non-d2w components


  • Subject: d2wContext in non-d2w components
  • From: Mark Wardle <email@hidden>
  • Date: Sun, 1 Nov 2009 20:27:02 +0000

Anything dodgy about doing this in my PageWrapper class? It seems to work...

	/**
	 * Returns the current D2W context, creating one if it doesn't already exist...
	 * @return
	 */
	public D2WContext d2wContext() {
		NSSelector<Void> sel = new NSSelector<Void>("d2wContext");
		if(sel.implementedByObject(context().page())) {
			return (D2WContext) context().page().valueForKey("d2wContext");
		}
		if (context().hasSession()) {
			return new D2WContext(context().session());
		}
		return new D2WContext();
	}

I'm creating a D2W context if there isn't already one provided by the page.

I think this is the only way I can make non-D2W components aware of
the D2W rules?

Thanks,

Mark

--
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK
 _______________________________________________
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

  • Prev by Date: Re: Eclipse 3.5.1 and WOLips and 32bit
  • Next by Date: Customising D2W - adding filtering to list pages
  • Previous by thread: Re: Eclipse 3.5.1 and WOLips and 32bit
  • Next by thread: Customising D2W - adding filtering to list pages
  • Index(es):
    • Date
    • Thread