getParameter (XSPUrl - JavaScript)

Gets the value of a query string parameter.

Defined in

XSPUrl (JavaScript)

Syntax

getParameter(name:string) : string
Parameters Description
name The name of an existing parameter.
Return value Description
string The value of the parameter.

Example

This example gets the value of each parameter in the URL for the current context.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

var url : XSPUrl;

try {
	url = context.getUrl();
	var n = url.getParametersCount();
	p("getParametersCount = " + n);
	for(var i=0; i<n; i++) {
		var name = url.getParameterName(i);
		p(name + " = " + url.getParameter(name));
	}

} catch(e) {
	p("Error = " + e);
}

Print output from the example might be as follows:

<<<getParametersCount = 7>>>
<<<WP_BUSINESS_OBJECT_DATA = rp0707test1>>>
<<<WP_BUSINESS_OBJECT = ejb/com/ibm/component/designer/ejb/DesignerComponent>>>
<<<action = openDocument>>>
<<<database = rp0707test1>>>
<<<schema = Schema_form1>>>
<<<id = 3fb66696c9e31>>>
<<<autoedit = true>>>