cancel
Showing results for 
Search instead for 
Did you mean: 

Passing param directly in the Address bar

Former Member
0 Kudos

I am trying to pass a preset Param through my URL. The param does not come from another source. I am manually typing this in the address. I can not get this to work. Does this only work when passing params from one irpt to another. I could have sworn I saw our instructors simply type this in the address bar.

What is wrong with this...

http://localhost/QA/QA_SK_Centers.irpt?Param.1=B

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Part two question...

If I have an hyperlink image on one page that has a name that would indicate my param that I want to pass, could I use the name to embedd it in my URL?

jcgood25
Active Contributor
0 Kudos

Aside from just including the necessary NAME=VALUE parameter in the href for your image or in the associated onClick event, the way to allow a named object on a web page to automatically pass the corresponding value is through an html form. If you submit an html form to your irpt page (using 'GET' to see the parameters or 'POST' to hide the parameters from the URL address line) using either hidden or visible form field elements, all named input boxes, etc. will naturally send their corresponding values to the page.

Here is a very simple example:

<FORM METHOD="GET" TARGET="_blank" ACTION="/QA/QA_SK_Centers.irpt">

Line: <INPUT TYPE="TEXT" NAME="Line" VALUE="B">

<INPUT TYPE="SUBMIT" VALUE="TEST">

</FORM>

Former Member
0 Kudos

I see that is works great, but I don't seem to understand how this...

Line: <INPUT TYPE="TEXT" NAME="Line" VALUE="B">

<INPUT TYPE="SUBMIT" VALUE="TEST">

created this...

../QA/QA_SK_Centers.irpt?Line=B

Could you further explain so I know how to decipher your code?

Thanks!!

jcgood25
Active Contributor
0 Kudos

The Submit button is a part of the html form and the Action attribute of the form itself is where the web page path is located. Standard html form processing applies to the input element with the NAME="Line". The value comes from the input box itself and the NAME=VALUE is added to the end of the action in this format: /ACTION?NAME=VALUE&NAME2=VALUE2

This really is html, not xMII, but an html form can easily be used to pass page parameters into the irpt web page.

Former Member
0 Kudos

How do I apply what you have into this...

<b><tr name="B"></b>

<b>a href = "../QA/QA_SK_FinalWeights.irpt?Line=B"</b>

if I name the Row of a table is where I want the above code to extract from?

jcgood25
Active Contributor
0 Kudos

Unfortunately you cannot just apply a name attribute to any arbitrary html element. The form submit process will only apply to the standard elements like hidden fields, input boxes, check boxes, etc.

If you want to go beyond the standard html form elements then you will need to handle more of the parameter efforts through javascript. A hidden form field with the name="Line" would be a way to keep the submit example I shared with you operational, but you will need to set the corresponding value from each Row of your table before the submit occurs.

Your code snippets do not really give any ideas as to what you are trying to accomplish, especially if you are embedding the full URL (which includes the Line parameter) into your html. Can you share more of the page than just a small extract?

jcgood25
Active Contributor
0 Kudos

Here is a rudimentary page that might help:


<html>
<head>
<title>Sample Page</title>

<script type="text/javascript">
function ShowPage(strID) {
	alert("You selected Line: " + strID);
	document.getElementById("Line").value = strID;
	document.frmTest.submit();
}
</script>
</head>

<body>

<form name="frmTest" id="frmTest" method="GET" target="_blank" action="/QA/QA_SK_Centers.irpt">
<input type="hidden" name="Line" id="Line" value="">

<table border="0" cellspacing="4" cellpadding="0">
<tr>
	<td>
		<div id="A" onClick="javascript:ShowPage(this.id);" style="cursor:hand;">
			<a href="javascript:void(0);">Line A</a>
		</div>
	</td>
</tr>
<tr>
	<td>
		<div id="B" onClick="javascript:ShowPage(this.id);" style="cursor:hand;">
			<a href="javascript:void(0);">Line B</a>
		</div>
	</td>
</tr>
</table>


<!--input type="Submit" value="Test"-->
</form>

</body>
</html>

Regards,

Jeremy

Answers (2)

Answers (2)

sufw
Active Participant
0 Kudos

As Jeremy indicated, you'd have to use JavaScript to extract the URL argument and write it into the TD node in your HTML. Take a look at and others in this forum on how to extract URL arguments. You can then use something like the following to write the value into your table row:

document.getElementById('B').innerHTML = '<td>' + value + '</td>';

(provided that the tr nodes have id attributes rather than names)

Former Member
0 Kudos

I got it now. I knew you had to pass a param into the applet, but I was unsure how.

So I did this...

<b><param name="Param.1" value=" "></b>

for the applet and the URL looks like this now...

<b>http://localhost/QA/QA_SK_Centers.irpt?Line=B</b>

Everything works now.