Message Boards

Liferay.Util.addParams - More than one parameter

Manuel Baltieri, modified 3 Years ago.

Liferay.Util.addParams - More than one parameter

New Member Posts: 7 Join Date: 4/21/20 Recent Posts

This is my code right now:

function downloadFile(fileIdValue)
{
	var downloadResUrl = '<portlet:resourceURL></portlet:resourceURL>';
	location = Liferay.Util.addParams("fileId="+fileIdValue, downloadResUrl);
	return false;
}

How i can add another parameter?

I've searched some example but i did not find anything.

Thanks,

Manuel

 

 

thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Liferay.Util.addParams - More than one parameter (Answer)

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts

Hi,
You can try below way, adding param to updated URL.

function downloadFile(fileIdValue1, fileIdValue2)
{
	var downloadResUrl = '<portlet:resourceURL></portlet:resourceURL>';
	downloadResUrl = Liferay.Util.addParams("param1="+fileIdValue1, downloadResUrl);
    downloadResUrl = Liferay.Util.addParams("param2="+fileIdValue2, downloadResUrl);
    location = downloadResUrl ;
	return false;
}

 

Manuel Baltieri, modified 3 Years ago.

RE: RE: Liferay.Util.addParams - More than one parameter

New Member Posts: 7 Join Date: 4/21/20 Recent Posts

Thanks, it work =)