cancel
Showing results for 
Search instead for 
Did you mean: 

I am not able to read the xslt table column value.

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thank you Selvakumarthae code you sent is working fine.

Answers (0)