• 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: Drew Thoeni <email@hidden>
  • Date: Sun, 8 Apr 2007 22:24:31 -0400

Thanks. I checked that first. I actually went to the WOComponent and copied and pasted the name from there.

I tried your code and got the same error. I'm sure it's something I'm doing (or not) based on my limited knowledge in this area. I'm reworking the code to run out of the WOComponent that is used to create the HTML email. Another example of one's coding skill determining the method.

Regards,

Drew

On Apr 8, 2007, at 6:51 PM, jerry porter wrote:

First of all are you sure you don't have a typo?

Perhaps its EmailHtmlTemplate for example

Is the class you are looking for in a different package?


Also a better pattern for creating pages is: EmailHTMLTemplate mailPage = (EmailHTMLTemplate)pageWithName ( EmailHTMLTemplate.getClass().getName() );

This reduces "typos" during runtime by catching them at compile tim.



--- Drew Thoeni <email@hidden> 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:
40yahoo.com


This email sent to email@hidden


---- Being human is the strangest thing I have ever done.

Jerry Porter
IT Distribution MS 34-202
Lincoln Financial Group
One Commerce Square
2005 Market Street
Philadelphia, PA 19103
(215) 255-7031



______________________________________________________________________ ______________
8:00? 8:25? 8:40? Find a flick in no time
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

_______________________________________________ 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: editingContext.deleteObject(object) immediately destroys relationships?
  • Next by Date: WOWODC news
  • Previous by thread: Re: pageWithName
  • Next by thread: editingContext.deleteObject(object) immediately destroys relationships?
  • Index(es):
    • Date
    • Thread