• 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: pageWithName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pageWithName


  • Subject: Re: pageWithName
  • From: Miguel Arroz <email@hidden>
  • Date: Mon, 9 Apr 2007 00:00:42 +0100

Hi!

The short reason for this is simple: pageWithName needs to know the context so that it may correctly initialize the EmailHTMLTemplate component internal data structures, and also some stuff on the Session, if it exists (like backtracking, I guess).

An WO app is not just a bunch of web pages. Each time you return (or generate) a component, it must be integrated in all the app flow. For example, an obvious reason why you need to give context to the "component generator" (the magic behind pageWithName) is because the current language is part of the context info. So, WO needs to know the context to know what is the version of the component it should load from disk.

More experienced WO guys will tell you all about this in more detail, but I think my text is a bit superficial, but correct! :)

  Yours

Miguel Arroz

On 2007/04/08, at 23:32, Drew Thoeni wrote:

I'm sure I'm missing a small bit of common WOKnowledge, because this seems pretty basic. But help would be greatly appreciated.

I'm sending an HTML email using a WOComponent as the source. I've done this before from within another component but I'm now trying to do this in a separate (non-WOComponent) standard Java class.

I started with:

EmailHTMLTemplate mailPage = (EmailHTMLTemplate)pageWithName ( "EmailHTMLTemplate" );

And got "cannot find symbol"

Thinking the errant symbol might be "pageWithName", I tried this:

EmailHTMLTemplate mailPage = (EmailHTMLTemplate) WOApplication.application().pageWithName( "EmailHTMLTemplate", context() );

Ditto. So, do I need to pass in a context()? If so, how? (FYI: this is a static method and being called from a WOComponent).

Or, am I looking at this all wrong and trying to force fit something? Anytime I get into a spot like this I think back to Jonathan Rentzsch's "If you're writing code, you're doing something wrong" maxim. Perhaps I'm headed in the wrong direction.

Regards,

Drew

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40guiamac.com


This email sent to email@hidden


"We have no sympathy for the lost souls
We've chosen the path of disgrace
We give this life to our children
And teach them to hate this place" -- Apocalyptica, Life Burns!

Miguel Arroz
http://www.ipragma.com


_______________________________________________ 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: 
 >pageWithName (From: Drew Thoeni <email@hidden>)

  • Prev by Date: pageWithName
  • Next by Date: editingContext.deleteObject(object) immediately destroys relationships?
  • Previous by thread: pageWithName
  • Next by thread: Re: pageWithName
  • Index(es):
    • Date
    • Thread