Suntower
Posts: 225
|
| Posted: 08/16/2006, 12:20 PM |
|
Hi,
I'm having -exactly- the same problem as this guy... http://forums.yessoftware.com/posts.php?post_id=73633
It doesn't bode well that he got no reply. Grrrrr.....
Anyway, I fired up the CCSExample for the Employee Popuplist. That works -fine-. I cut and pasted the code into my project and the popup window will not close.
<script language="JavaScript">
function SetOpenerValue(currentObj)
{
var IE = (document.all) ? 1 : 0;
if(IE) {
var SHID = currentObj.innerText;
} else {
var SHID = currentObj.text;
}
window.opener.document.updatesoheaders.fob.value = SHID;
window.opener.focus();
window.close();
}
If I remove the line
opener.document.updatesoheaders.fob.value = SHID;
...it closes just fine, but of course the value isn't passed back to the parent window. Any ideas on how to troubleshoot this? Can I assume that I'm addressing the opener document incorrectly? If so, I don't see how---I've checked the spelling about,oh... 30 times.
Thoughts?
THANKS!
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/16/2006, 1:19 PM |
|
Before you ............. about no response (GRIN)
Use the Search in the top of this Forums menu and search for
"Popup window close" there are several interesting topics.
I think it is something to do with reload.
Your page is not using frames or Iframes?
I am no JS star.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
Suntower
Posts: 225
|
| Posted: 08/16/2006, 1:42 PM |
|
Hi Walter,
First... thanks for the reply. My general irk is not directed at -you-. It's just that, every time I try to get started with CCS, I run into walls like this---which are drop dead simple in other types of programming and then there just aren't a lot of resources for getting a response NOW so I can plod forward.
OK,... I read through a number of topics and they seem to fall into a couple of categories:
1. Suggestions to try the CCSExamplePack.
2. Showing that there are syntax errors in the poster's code.
So... I'm using -exactly- the example I need and I -think- I've got the right syntax. So...
HOW DO I TROUBLESHOOT THIS?
Specifically: Why does adding the line
window.opener.document.updatesoheaders.fob.value = SHID;
...cause the window to never close. In fact, it appears that the function simply dies right there without bringing up an error or anything. The page simply reloads.
I need help learning how to troubleshoot this kind of thing so I can do it myself. But it seems that EVERY technique I try has some little dealie like this that really requires hands on instruction. IOW: I -know- that if someone who did this stuff all day were here, they would see the problems in 2 seconds.
HEEELLLLLPPPP!
---JC
Quote wkempees:
Before you ............. about no response (GRIN)
Use the Search in the top of this Forums menu and search for
"Popup window close" there are several interesting topics.
I think it is something to do with reload.
Your page is not using frames or Iframes?
I am no JS star.
Walter
_________________
---On a campaign for more examples and better docs! |
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/16/2006, 2:30 PM |
|
http://forums.codecharge.com/posts.php?post_id=60187&s_...dow+close+popup
Suggests to use:
function SetOpenerValue(SHID)
contrary to
function SetOpenerValue(currentObj)
http://forums.codecharge.com/posts.php?post_id=25532&s_...dow+close+popup
discusses the reload
and this comes from the Example"s:
At the top of the page, add the Close Window Link control.
Under the Format tab of the Properties window, add the On Click event for the link to: window.close();
Walter, my money is on the first !
BTW : SHID is not a reserved word, I checked.
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
Suntower
Posts: 225
|
| Posted: 08/16/2006, 7:43 PM |
|
Sadly, none of these work. My strong suspicion is that the object
opener.document.updatesoheaders is somehow wrong, even though that -is- the name of the record/form in the parent page.
Any ideas on how to get a LIST of objects (in text format) that are -really- being passed to the called page so I can figure out what the called page is actually seeing?
Thanks!
---JC
Quote wkempees:
_________________
---On a campaign for more examples and better docs! |
 |
 |
Suntower
Posts: 225
|
| Posted: 08/16/2006, 9:17 PM |
|
Just for kicks, I tried the following JS:
with (window.opener.document)
{
for (i in this)
{
write("Property = " + i + " Value = " + window.opener.document + "<BR>\n")
}
}
...and it shows -nothing-. So is it possible that the popup list page isn't receiving the opener object from the parent? If so, why?
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
Suntower
Posts: 225
|
| Posted: 08/17/2006, 12:03 PM |
|
OK, I figured it out. Or rather, I didn't.
I did what I usually do when this kind of crap happens in CCS: I started over with a blank page and re-added the elements as before one by one. And of course, now it works.
The thing that bothers me so much about this (and I dunno if it's CCS or js or ASP or VB or cosmic rays) but whenever this has happened, the fact that I can't deduce -WTF- was going on leaves me cold. In C or whatever you can almost -always- figure it out.
Things I learned (for any travellers who pass this way):
1. VERY BAD: JS sucks for one basic reason: If you attempt to address a page object that doesn't exist, no error is thrown. Rather, the function simply stops executing at that point. And you can't figure out -why- without lots of commenting and CONFIRMs. Or at least, -I- can't at this baby stage of learning.
2. PRETTY GOOD: The SetOpenerValue() can -easily- be used to return as many variables as you like to your parent page:
SetOpenerValue('{NAME}','{ADDRESS1}','{ADDRESS2}')
...which is mighty, mighty handy. In fact, I'd urge Yessoftware to update the example to demonstrate this as a number of people seem to have asked about returning multiple variables over the years in this forum.
Just writing for posterity, I guess.
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/17/2006, 3:11 PM |
|
Tx for posting back.
Glad you made it work.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
Suntower
Posts: 225
|
| Posted: 08/17/2006, 4:11 PM |
|
My pleasure. I think it's sort of my duty. What I notice on this forum is that way too many topics seem 'unfinished'. Someone posts an answer but then the original poster never ties it up by indicating whether or not the suggested solution actually -works- or not.
So sometimes, I can't be sure whether or not to -try- it.
I'd encourage everyone who posts a question to take the time to follow up with their success/failure.
Cheers for all your help, mate!
---JC
Quote wkempees:
Tx for posting back.
Glad you made it work.
Walter
_________________
---On a campaign for more examples and better docs! |
 |
 |
|