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

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.

  • Follow-Ups:
    • Re: variable return-classes
      • From: jacques couzteau <email@hidden>
References: 
 >Re: variable return-classes (From: jacques couzteau <email@hidden>)

  • Prev by Date: Re: variable return-classes
  • Next by Date: Creating a Table on the DBMS from EOF?
  • Previous by thread: Re: variable return-classes
  • Next by thread: Re: variable return-classes
  • Index(es):
    • Date
    • Thread