Re: WebObjects PU
Re: WebObjects PU
- Subject: Re: WebObjects PU
- From: James Cicenia <email@hidden>
- Date: Sun, 26 Dec 2004 18:59:11 -0600
Dan -
First off here is my javascript that is in a blank component that is called from the popup:
<x-tad-bigger><SCRIPT LANGUAGE=Javascript>window.opener.location.href = '<webobject name=WOAction1></webobject>';self.close();</SCRIPT>
Here is the binding:
WOAction1: WOActionURL {
pageName = returnPage;
}
I call a DirectAction as this cured my page cache issue.
</x-tad-bigger>Now concerning my problem:
Since I am calling my page again via a direct action, it should just work. The lists are populated from a relationship.
Anyway, I hope the javascript helps you.
On Dec 26, 2004, at 1:15 PM, Dan Faber wrote:
James:
I think I can tell you how to do what you are trying to do.
Instead of using the editingcontext to communicate between the two components, you should have them communicate directly with each other:
1. In your main or "calling" page, include a method that sets up the lists according to the newly assigned template:
public void setUpLists(template newTemplate) {
//code to setup lists here
}
2. When generating the component for the popup, put in a reference to the calling page:
public popUpPage doPopUpPage() {
popUpPage nextPage = (popUpPage)pageWithName("popUpPage");
nextPage.setCallingPage(this);
return nextPage;
}
3. In the popUpPage component, include a global variable to hold the reference to the calling page:
protected WOComponent callingPage;
and include a setter method:
public void setCallingPage(WOComponent newCallingPage) {
callingPage = newCallingPage;
}
4. Then when the user changes the template in the popup page, call the method to update the calling page:
public void newTemplate() {
//this will update the calling page lists
callingPage. setUpLists(userSelectedTemplate);
//other code as needed here
}
Using this method, it is probably easiest to use the same editing context for both pages, but not necessary as long as the template that is passed back to the calling page is "localized" to it's editing context.
BTW, I have had trouble with some browsers not updating the calling page correctly. Can you share with me what javascript code you are using to get the calling page to refresh?
Good luck
Dan Faber
email@hidden
_______________________________________________
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