on 02-29-2012 12:45 PM
Hi,
I have the scenario like this.
I have two irpt pages first.irpt and second.irpt and saperate xslt tables for each page and common js file for two pages.
when I click on first.irpt page xslt table row that opens the second.irpt as a popup window then I click on the column in second.irpt xslt row after that column value should be inserted in to first.irpt xslt table column.
In above I have done everything except I am not able to update the first.irpt xslt table column as Even I am not able to read that value.
For your reference:
/* This function will be called when we select the row in first.irpt xslt table here SelectBatch_b.irpt means second.irpt
function getBatch(row)
{
var id=row;
var material=document.getElementById('Material_'+row).value;
var location=document.getElementById('StoreLoc_'+row).value;
var plant=1000;
var strUrl = "SelectBatch_b.irpt";
strUrl = "?plant="plant"&""location="location"&""material="material;
window.open (strUrl,"mywindow");
}
/*This function will be called when we select the row in second.irpt (SelectBatch_b.irpt)
function getBatchID(row)
{
var Batch=document.getElementById('Batch_'+row).value; // reading second.irpt xslt table column value
document.getElementById('Batchc1').value=Batch; // reading first.irpt xslt table column value and inserting.
window.close(); // here I am getting error like object expected.
}
Please help me in this .
Edited by: rajkumar12345 on Feb 29, 2012 1:45 PM
Hi Rajkumar,
Please find below the method to pass the variable back and forth in .irpt page.
First Page:
var Toaccessinchildpage = "value";
function getBatch(row)
{
var id=row;
var material=document.getElementById('Material_'+row).value;
var location=document.getElementById('StoreLoc_'+row).value;
var plant=1000;
var strUrl = "SelectBatch_b.irpt";
strUrl += "?plant="plant"&"+"location="location"&"+"material="+material;
window.open (strUrl,"mywindow");
}
function populate(strBatch)
{
document.getElementById('Batchc1').value=strBatch;
}
Second Page:
function getBatchID(row)
{
var Batch=document.getElementById('Batch_'+row).value;
window.opener.populate(Batch);
window.close();
}
You have to call parent page function from child page.
No need to use common js.
If you want to access variable from parent page use
window.opener.<variable name>.
Example
window.opener.Toaccessinchildpage
You have to declare that variable as global variable in Parent page js file.
Refer First page code.
Regards,
Selva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.