Re: Trouble referring to an item in a WORepetition in Java code
Re: Trouble referring to an item in a WORepetition in Java code
- Subject: Re: Trouble referring to an item in a WORepetition in Java code
- From: David Holt <email@hidden>
- Date: Thu, 24 Nov 2005 16:49:28 -0800
Hi Shaun,
Thanks for your feedback. I would normally have done as you suggested,
but I wanted to attempt it with the Survey object in the session code.
What is not obvious from the simplified example is that there are
several components referring to the Survey object and I wanted to see
if I could implement the code without having to pass the object from
component to component. It seems to work well.
David
On 24 Nov 2005, at 4:35 PM, wojingo wrote:
G'day,
David Holt wrote:
Hi all,
In my Main component I have a conditional that appears if a user has
created a survey. It is bound to session.user.surveys.@count. Inside
the conditional I have a WORepition set to session.user.surveys and
the item is aSurvey. There is a hyperlink to a method that returns
the edit page.
I want to keep the survey data in the session (session.aSurvey). I am
trying to pass the edit page the survey object, but I don't know how
to access the session.user.surveys.aSurvey seen in WOBuilder using
Java.
What should this method be?
public EditSurvey toEdit()
{
EditSurvey nextPage = (EditSurvey)pageWithName("EditSurvey");
// Initialize your component here
mySession.setASurvey = ??????
return nextPage;
}
Not sure if I'm pointing out what you already know or not, but you can
do the following rather than putting everything in the session.
protected Survey aSurvey; //iterator of survey repetition.
public EditSurvey toEdit() {
EditSurvey nextPage = (EditSurvey)pageWithName("EditSurvey");
nextPage.setTheSurvey(aSurvey);
// If you want to stick with the code style you had in your
// other email.
nextPage.takeValueForKey(aSurvey, "iSurvey");
return nextPage;
}
regards,
- shaun
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden