Re: variable return-classes
Re: variable return-classes
- Subject: Re: variable return-classes
- From: "Adam Chan" <email@hidden>
- Date: Fri, 5 Sep 2003 15:36:30 -0600
no, only this, not this()
"this" is a reserve word in Java referring to the current object itself,
just like "self" in Object C. Java is more restrict on everything so you
will need to pay extra attention on casting.
So in your example:
EditStory nextPage = (EditStory)pageWithName("EditStory");
nextPage.setOpener(this);
or
WOComponent nextPage = pageWithName("EditStory");
((EditStory)nextPage).setOpener(this);
In EditStory class
public class EditStory extends WOComponent {
private WOComponent opener;
public void setOpener(WOComponent myOpener){
opener = myOpener;
}
public WOComponent doSomething() {
//.....
return opener;
}
}
----- Original Message -----
From: "jacques couzteau" <email@hidden>
To: "Adam Chan" <email@hidden>; <email@hidden>
Sent: Friday, September 05, 2003 2:12 PM
Subject: Re: variable return-classes
>
> Am Freitag, 05.09.03, um 22:03 Uhr (Europe/Berlin) schrieb Adam Chan:
> > objectToReturnToFromEdit = this
> >
>
> thanks. i tried this(). close but no cigar :)
>
>
>
> greetz from germany
>
> good night.
_______________________________________________
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.