Components need to be created using the 'pageWithName' method. This method
forwards the current context into the newly created component. So, change
your code to look something like this:
WORedirect nextPage = (WORedirect)this.pageWithName("WORedirect");
nextPage.setURL("http://www.yahoo.com");
return nextPage;
- Eric
-----Original Message-----
From: Doug Ellis <[EMAIL PROTECTED]>
To: Multiple recipients of list <[EMAIL PROTECTED]>
Date: Wednesday, February 24, 1999 2:26 PM
Subject: WOF 4.0 Bug?
>I hesitate to submit this, because I fear the bug is mine. But, here
>it goes...
>
>Here is a simple WOF4.0 (NT) app that crashes. I suspect the crash has
>to do with retain counts and the bridge, but I'm not smart enough to
>know why.
>
>To try this app, simply use PB to make a new WOF app. Then paste in
>the html, wod, and java samples below into the Main component.
>
>When you run it and click the link named "Go to Yahoo:" the app dies
>with:
>
> objc: FREED(id): message retain sent to freed object=0xa8ba30
>
>If you do a "setenv NSZombieEnabled YES" in GDB you will see:
>
> warning: Feb 24 17:19:23 Breaker[290] *** *** Selector 'retain' sent to
> dealloced instance 0xab6d90 of class WOContext.
> Break at '-[_NSZombie retain]' to debug.
> Stack=0x32046140 0x320461fe 0x4204101a 0x420407ef 0x69a94e7d
>
>Can someone please confirm this crashes for them, too?
>
>
>doug
>
>----HTML----
><HTML>
><HEAD>
> <TITLE>Page Title</TITLE>
></HEAD>
><BODY>
>
> <FONT SIZE=5>Breaker:</FONT>
> <BR>
> <BR>
> <WEBOBJECT NAME= YahooLink>
> Go to Yahoo
> </WEBOBJECT>
> <BR>
> <BR>
> <WEBOBJECT NAME=HereLink>
> Stay Here</WEBOBJECT>
> </BODY>
></HTML>
>
>----WOD----
>HereLink: WOHyperlink {
> action = stayHere;
>}
>YahooLink: WOHyperlink {
> action = jumpToYahoo;
>}
>
>----JAVA----
>// Generated by the WebObjects Wizard Wed Feb 24 16:54:40 US/Eastern
>1999
>
>import com.apple.yellow.foundation.*;
>import com.apple.yellow.webobjects.*;
>import com.apple.yellow.eocontrol.*;
>
>public class Main extends WOComponent {
>
> public WOComponent jumpToYahoo() {
> WORedirect nextPage = new WORedirect();
> nextPage.setURL("http://www.yahoo.com");
> return nextPage;
> }
>
> public WOComponent stayHere() {
> return null;
> }
>
>}
>
>_________________________________________________________
>DO YOU YAHOO!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>