Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: portlet:resourceURL parameters with Javascript
Manuel Baltieri, geändert vor 5 Jahren.
New Member
Beiträge: 7
Beitrittsdatum: 21.04.20
Neueste Beiträge
Hello,
how i can populate the "fileId" parameter value
with the value passed when i call the function downloadFile?
function downloadFile(fileIdValue)
{
location = '<portlet:resourceurl><portlet:param name="fileId" value="fileIdValue" /></portlet:resourceurl>';
}
Manuel Baltieri, geändert vor 5 Jahren.
Junior Member
Beiträge: 32
Beitrittsdatum: 07.03.12
Neueste Beiträge
fileIdValue is your request parameter?
If so, scriptlet can help in this.
Else if this will be javascript value only, you may need to have initial resource url available as js variable (say downloadResUrl) and append the parameter to that in javascript scope only.
If so, scriptlet can help in this.
Else if this will be javascript value only, you may need to have initial resource url available as js variable (say downloadResUrl) and append the parameter to that in javascript scope only.
function downloadFile(fileIdValue)
{
var downloadResUrl = '<portlet:resourceurl></portlet:resourceurl>';
location = Liferay.Util.addParams("fileId="+fileIdValue, downloadResUrl);
}
Manuel Baltieri, geändert vor 5 Jahren.
New Member
Beiträge: 7
Beitrittsdatum: 21.04.20
Neueste Beiträge
Tanks fot the support Yogesh Sharma.I've implemented it and now my code is more clean =)
This is my actual code now:
function downloadFile(fileIdValue)
{
var downloadResUrl = '<portlet:resourceURL></portlet:resourceURL>';
location = Liferay.Util.addParams("fileId="+fileIdValue, downloadResUrl);
return false;
}
Community
Company
Feedback