cancel
Showing results for 
Search instead for 
Did you mean: 

Passing params into an iFrame

Former Member
0 Kudos

Ok last question. I promise.

I have an iframe that in my irpt that I would like to pass a param from the main page into the iframe.

Can I use the below javascript:iframe as a src= instead of href= and instead of ('Cored Wire') can I use document.Line.getBrowserObject().getSelectedDatalinkValue();

I need to be able to stick the ibrowser value into this function so the iFram updates with the correct information.

href="javascript:iFrame('Cored Wire');"


function SelectLine(X)
{
				
	var LineID = document.Line.getBrowserObject().getSelectedDatalinkValue();
	var strUrl = "FR_Input_Production_History.irpt?Line=" + X;
	document.ifrReport.window.location.href = strUrl;

}

href="javascript:iFrame('Cored Wire');"

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

So, if I understand you correctly, you have a drop down iBrowser on the main page. When a user selects a Line from the iBrowser, it fires the SelectLine(X) JS function and you want the iframe on the page to load the FR_Input_Production_History.irpt page with the correct Line as a URL param?

So if your iframe is defined something like this:


<iframe id="ifrReport" src=""></iframe>

Then your JS code "document.ifrReport.window...." could be replaced with:


document.getElementById("ifrReport").src = strUrl;

I hope this isn't your last question! I like SDN points and T-shirts...

Former Member
0 Kudos

I think you should send us some t-shirts for all of our questions.

Technically, I do not need the X in my function since it is not in my source anymore.

Here is my solution.


function SelectLine()
{			
	var LineID = document.Line.getBrowserObject().getSelectedDatalinkValue();
	var df = document.frmMain;

	document.WorkOrder.getQueryObject().setParam(1, LineID);
	df.tLine.value = LineID;
	document.WorkOrder.updateBrowser(true);

	var strUrl = "FR_Input_Production_History.irpt?Line=" + LineID;
	document.getElementById("ifrReport").src = strUrl;
}

<iframe align="center" name="ifrReport" src="" height='510'width='750' id="ifrReport"></iframe>

Former Member
0 Kudos

Now my question is since I have an iFrame that allows me to view data while maintain my current page, how can I select a record (row) in the iReport extract cell number 2, bring it in as a var in the main page and then push it into an iChart in the iframe.

So in a sense, I will open an iGrid in the iFrame, select a record grabbing cell 2, and push cell 2 into param 2 of an iChart in the iFrame.

Former Member
0 Kudos

Are the iGrid and the iChart on the same .irpt page - which happens to be the iframe?

If so, put a selectionEvent on the iGrid, get the cell2 of the selected row by using document.iGrid.getGridObject().getSelectedCellValue(column) or document.iGrid.getGridObject().getSelectedCellValueByName(name) and pass that into the iChart as document.iChart.getQueryObject().setParam(2, document.iGrid.getGridObject().getSelectedCellValue(column));

Former Member
0 Kudos

No, I have the iGrid and the iChart on separate irpts pages.

Former Member
0 Kudos

OK, if you want to use the an applet on the main page FROM the iframe page, use something like:

parent.document.<appletName>.getGridObject().getCellValue(1,1)

If you want to reference an applet in the iframe FROM the main page, use something like:

window.<iframeName>.document.<appletName>.getGridObject().getCellValue(1,1)

Answers (0)