Re: variable return-classes
Re: variable return-classes
- Subject: Re: variable return-classes
- From: "Adam Chan" <email@hidden>
- Date: Fri, 5 Sep 2003 14:03:21 -0600
objectToReturnToFromEdit = this in your case.
----- Original Message -----
From: jacques couzteau
To: Adam Chan ; email@hidden
Sent: Friday, September 05, 2003 12:51 PM
Subject: Re: variable return-classes
thanx. but i don't know enough about java to implement the idea.
Am Freitag, 05.09.03, um 21:25 Uhr (Europe/Berlin) schrieb Adam Chan:
Say you have components C1, C2, C3, and both C1, C2 goto C3. When C3 is
done, page will go back to the caller (C1 or C2).
You can actually pass the caller C1 or C2 (not the name but the actual
WOComponent object) to C3. In other words, you will have a
setCaller(WOComponent c) method in C3. Once C3 is done, just do a return
caller statement.
that was what i had in mind. but i don't know how to write the code. here is
what i got:
EditStory nextPage = (EditStory)pageWithName("EditStory");
nextPage.setOpener(objectToReturnToFromEdit);
// how do i name objectToReturnToFromEdit??? What is it called in java???
return nextPage;
i have a setOpener in EditStory:
public void setOpener(WOComponent myOpener){
opener = myOpener;
}
and do a
return opener;
when i'm done
But my BIG problem is:
what is the name or proper syntax for for refencing
objectToReturnToFromEdit???
i suppose it's a very simple thing but i don't know how to call it.
please give me a hint
greetz
couzteau
Of course there are many other ways. You can also use session to keep track
of the page(WOComponent) flow. Indeed, session does have a history to
remember the path.
----- Original Message -----
From: "jacques couzteau" <email@hidden>
To: <email@hidden>
Sent: Friday, September 05, 2003 11:21 AM
Subject: variable return-classes
hello,
I've a a simple qustion which is probably very fundamental for
programming with java in general.
I made a component which is for editing data of an object from my
database (a row) called EditStory. This editing component is can be
called from 2 (may be later more) different other components. For
instance I have a list view where many rows are shown (Blog) and
detailview where only on row is shown at a time (FullStory). Both of
these can call the edit page 'EditStory'.
After making the changes in the EditView (and saving them), i want to
return to the calling component.
My first approach was to pass the name of the calling class as string
to EditStory. But then i have to do quite inflexible handling of the
arguments of the calling classes.
So my 2nd idea was to that the calling component passes itself as an
argument to the EditStory-component. Now I don't know if that is
possible and how it can be accomplished, since i'm new to java.
Alternatively i was considering to create a new component initialise
that and then pass the clone as argument (the calling clones itself
before going to edit and passes this to Edit).
inside the FullStory-Object:
FullStory objectToReturnToFromEdit = new FullStory();
But i get the compiletime error message: cannot resolve symbol:
construtor Fullstory(ec);
I don't know which way is best (easiest, cleanest and sevest)
can someone explain?
greetz couzteau
_______________________________________________
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.
::: jochen Hagenstroem
::: www.hagenstrom.de
::: email@hidden
::: hamburg, germany
_______________________________________________
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.