Re: WOComponent template method
Re: WOComponent template method
- Subject: Re: WOComponent template method
- From: Chuck Hill <email@hidden>
- Date: Tue, 27 Jan 2004 10:59:35 -0800
PA's solution is more involved than what is strictly needed. It may avoid
the debug message, he is using some quasi-private stuff.
It can be quite easy:
protected WOElement myTemplate = null;
public WOElement template() {
if ( myTemplate == null ) {
myTemplate = WOComponent.templateWithHTMLString( html, wod, null );
}
return myTemplate;
}
At 11:22 AM 27/01/2004 -0600, Jonathan Rochkind wrote:
>At 9:08 PM -0600 1/26/04, Jeff Martin wrote:
>>I want to encapsulate a simple component in a single (source) file,
>>so my WOComponent subclass simply implements the template() method,
>>which in turn calls templateWithHTMLString() from a couple of String
>>literals for the HTML and wod data. WebObjects seems to be unhappy
>>with this - it takes a long time and it complains:
>
>I've never tried this, but here's some sample code (written for
>previous versions of WO) that alleges to demonstrate how to do this.
>I'd think you could it a lot simpler than this, but maybe not.
>Anyway, hope you find it useful:
>
>http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/wa/Main?wikiPage=Loa
dingYourOwnHtmlAndWod
>
>--Jonathan
>
>
>>[2004-01-26 20:44:03 CST] <WorkerThread0>
>><com.webobjects.appserver._private.WOComponentDefinition> No
>>template found for component RMPDFPage at
>>"file:/Temp/Builds/Movies.woa/".
>>
>>How can I make it not look for a template file?
>>
>>Also, my test app seems to work best if I specify the whole path to
>>my component in pageWithName() (eg,
>>pageWithName("com.reportmill.webobjects.RMPDFPage"). Is this the
>>recommended convention?
>>
>>jeff
>>_______________________________________________
>>webobjects-dev mailing list | email@hidden
>>Help/Unsubscribe/Archives:
>>http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>Do not post admin requests to the list. They will be ignored.
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.