In my application, I call one popup winodow by using this link..
[HTML]<a href="#" onClick="return showWindow('1','XYZ');">
<img src="images/magnifier.gif" ALT="Chemicals" width=18 height=20 border=0>
</a>[/HTML]
In this showWindow function....
Expand|Select|Wrap|Line Numbers
- var newWindow = '';
- var url='jsp/DEPO/Chemicals/ProductConfigTabs.jsp';
- function showWindow(data1, data2)
- {
- if (!window.focus){return true;}
- if (!newWindow.closed && newWindow.location)
- {
- newWindow.location.href = url;
- }
- else
- {
- newWindow=window.open(url+'?abc=ABC&Id='+data1,'NewWin','toolbar=no,status=yes,width=520,height=440');
- if (!newWindow.opener) newWindow.opener = self;
- //Set value into Child window element.
- setTimeout("SendToChild('" + data1.toLocaleString() + "','" + data2.toLocaleString() + "')",20);
- if (window.focus){newWindow.focus();}
- }
- }
- //Pass value to child window..
- function SendToChild(data1,data2)
- {
- //Set Hidden value into child Window
- newWindow.document.getElementById("hiddenDivId1").value=data1;
- newWindow.document.getElementById("hiddenDivId2").value=data2;
- }
[HTML] <div id='hiddenDivId1'></div>
<div id='hiddenDivId2'></div>
[/HTML]
** But Some time i can access this hidden div of child window and some time not..
Please help me to pass parent window element values to child and vice-versa Or Any other way to pass value,
like what i did with url, by using parameter.. please check is this way correct to pass and get value in request
[HTML]<input type="hidden" name="Id" id="Id" value="<%=request.getParameter('Id')%>">[/HTML]
Please use code tags when posting code - moderator
I dont know what i am doing wrong in it. please help me in this problem.
Thanks,
Gajendra