OK..Thanks again for your help. I made it to work with a slight change
in the javascript in opener html. It now reads
<script type="text/javascript">
function siteOpened() {
//
window.location.href=document.getElementById("siteOpened").href;
window.location.reload();
}
</script>
So to summarize, "Cycle.activate("mypopuppage");" in the popup
listener reloaded the popup on submit, but this time when the popup
loads calls the opener javascript to reload the opener and closes the
popup by itself.
Thanks,
Vijay
Surya Prakash
<[EMAIL PROTECTED] To: Tapestry users
<[email protected]>
urface.com> cc:
Subject: RE: How can i
reload parent page consistently?
07/28/2005 11:15 AM
Please respond to
Tapestry users
Hi,
I also faced the same problem as I used similar code to refresh. So I
used a hidden link in the opener page and through java script from popup
page refreshed it, in the sense emulating clicking a link.
document.Form0.submit();
window.opener.location.reload(true);
window.close(); // will never be called as you already submitted it.
Try this (same code as mentioned previously):
Opener page:
<a jwcid="@PageLink" page="your page name" id="siteOpened"
style="display:none"/>
<script type="text/javascript">
function siteOpened() {
window.location.href=document.getElementById("siteOpened").href;
}
</script>
Popuppage.java:
public abstract boolean isCloseDialouge();
public abstract boolean setCloseDialuge(boolean value);
In your listener method, activate the popup page again:
setCloseDialogue(true);
Cycle.activate("mypopuppage");
Popuppage.html:
<script type="text/javascript">
Function closeDialogue(){
if (form.closeDialogue.value =="T") {
if (window.opener){
window.opener.siteOpened();
}
window.close();
}
<body onload="closeDialogue()">
Cheers,
Surya
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 28 July 2005 16:44
To: Tapestry users
Subject: RE: How can i reload parent page consistently?
Hello again,
My case is little simple. User opens a popup by clicking a link in
master window, picks a property from a list in popup. Selected property
should update a text field in master and the popup should close itself.
My problem is with the following step..
6. The javascript call in the popup page refreshes the data in the
opener.
Can you please tell me how you are doing that?
The following javascript does not cut it for me!
document.Form0.submit();
window.opener.location.reload(true);
window.close();
Thanks,
Vijay
Surya Prakash
<[EMAIL PROTECTED] To: Tapestry
users <[email protected]>
urface.com> cc:
Subject: RE: How can
i reload parent page consistently?
07/28/2005 10:04 AM
Please respond to
Tapestry users
Hi,
In my case, I am having two select lists, selecting an option in the
master list, changes the data in the child selection box. I want to
close the popup page only after selecting the child data, so I had to
check that way. If there is only one, then there is no need to check
when to close the popup.
Sorry, in the given code, I forgot to add this:
In the body tag:
<body onload="closeDialogue()"> calling the closeDialogue function.
Secondly, I don't want to display the link to the user which is merely
used for refreshing it from a popup, so the display is hidden.
The whole logic is like this:
1. User opens popup
2. Selects data in master list.
3. OnSubmitChange fires, goes back and refreshes the data in the child
list
4. User selects an option from the child list.
5. Submits the selection and in the popup page java, the submit property
is set to true now.
6. The javascript call in the popup page refreshes the data in the
opener.
7. Popup page is loaded again but as the submitted property is set to
true, body onload javascript function closes the popup.
Hope this helps.
Cheers,
Surya
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 28 July 2005 15:45
To: Tapestry users
Subject: RE: How can i reload parent page consistently?
Surya,
Thank you for your reply.
Could you please give me some detail about the logic. Are you trying
to send a duplicate trigger to the opener from popup so that it would
reload again?
I was wondering why the pageLink in opener page is hidden & not
displayable!
In the popup is the closeDialogue called after the popup submit?
Thanks,
Vijay
Surya Prakash
<[EMAIL PROTECTED] To: Tapestry
users <[email protected]>
urface.com> cc:
Subject: RE: How can
i reload parent page consistently?
07/28/2005 03:07 AM
Please respond to
Tapestry users
Hi,
I also faced the same problem, and came up with the following solution:
In your popup page, add something like this:
<script type="text/javascript">
function closeDialogue() {
var form =
document.getElementById("ok").form;
// ok is submit buttion id
if (form.closeDialogue.value ==
"T") {
if (window.opener)
window.opener.siteOpened();
// siteOpened is a javascript function in the opener page
closeWindow();
}
}
</script>
<form jwcid="@Form" listener="ognl:mylistener">
<input jwcid="[EMAIL PROTECTED]" type="hidden"
value="ognl:closeDialogue"/>
// In your opener page se the property closeDialogue to false initially.
// Set this value to true, once you submit the form in the popup page
// other form fields here
</form>
In your opener page, add like this:
<a jwcid="@PageLink" page="your page name" id="siteOpened"
style="display:none"/>
//above link is hidden from user
<script type="text/javascript">
function siteOpened() {
window.location.href=document.getElementById("siteOpened").href;
}
</script>
Hope this helps.
Surya
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 27 July 2005 18:07
To: [email protected]
Subject: How can i reload parent page consistently?
Hi,
I have the following scenario
1) From a tapestry page, i open a popup window using pagelink
2) User selects an item from propertyselection component in popup
3) User clicks a button in popup which triggers a javascript that
submits the popup,tries to reload the parent page and closes itself
4) Parent page pageBeginRender(PageEvent event) is called which
prints(in log file) the updated data, but the html page is not updated
with
new data (Embedded image moved to file: pic27606.gif)Question(I can see
it if i manually reload the page!)
My javascript is as follows:
<script language="JavaScript">
function processAddCriteria()
{
document.Form0.submit();
window.opener.location.reload(true);
window.close();
}
</script>
I tried //window.opener.document.forms[0].submit(); as suggested by
someone, it does not work either.
Any suggestions would be greatly appreciated!!
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]