<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>portlet:resourceURL parameters with Javascript</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118997124" />
  <subtitle>portlet:resourceURL parameters with Javascript</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118997124</id>
  <updated>2026-06-03T04:35:27Z</updated>
  <dc:date>2026-06-03T04:35:27Z</dc:date>
  <entry>
    <title>RE: portlet:resourceURL parameters with Javascript</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119146431" />
    <author>
      <name>Manuel Baltieri</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119146431</id>
    <updated>2020-12-15T20:18:48Z</updated>
    <published>2020-05-13T09:38:12Z</published>
    <summary type="html">&lt;p&gt;Tanks fot the support &lt;strong&gt;Yogesh Sharma.&lt;/strong&gt;I've implemented
  it and now my code is more clean =)&lt;/p&gt;
&lt;p&gt;This is my actual code now:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;function downloadFile(fileIdValue)
{
	var downloadResUrl = '&amp;lt;portlet:resourceURL&amp;gt;&amp;lt;/portlet:resourceURL&amp;gt;';
	location = Liferay.Util.addParams(&amp;quot;fileId=&amp;quot;+fileIdValue, downloadResUrl);
	return false;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Manuel Baltieri</dc:creator>
    <dc:date>2020-05-13T09:38:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: portlet:resourceURL parameters with Javascript</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118994545" />
    <author>
      <name>Yogesh Sharma</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118994545</id>
    <updated>2020-12-15T16:35:54Z</updated>
    <published>2020-04-21T14:33:46Z</published>
    <summary type="html">fileIdValue is your request parameter? &lt;br /&gt;
If so, scriptlet can help in this.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;function downloadFile(fileIdValue)
{
var downloadResUrl = '&amp;lt;portlet:resourceurl&amp;gt;&amp;lt;/portlet:resourceurl&amp;gt;';
location = Liferay.Util.addParams(&amp;quot;fileId=&amp;quot;+fileIdValue, downloadResUrl);
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp;&lt;/code&gt;&lt;/pre&gt;</summary>
    <dc:creator>Yogesh Sharma</dc:creator>
    <dc:date>2020-04-21T14:33:46Z</dc:date>
  </entry>
  <entry>
    <title>portlet:resourceURL parameters with Javascript</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118997123" />
    <author>
      <name>Manuel Baltieri</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118997123</id>
    <updated>2020-12-15T20:18:51Z</updated>
    <published>2020-04-21T12:49:57Z</published>
    <summary type="html">&lt;p&gt;Hello,&lt;br /&gt;how i can populate the &amp;quot;fileId&amp;quot; parameter value
  with the value passed when i call the function downloadFile?&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;function downloadFile(fileIdValue)
{
   location = '&amp;lt;portlet:resourceurl&amp;gt;&amp;lt;portlet:param name=&amp;quot;fileId&amp;quot; value=&amp;quot;fileIdValue&amp;quot; /&amp;gt;&amp;lt;/portlet:resourceurl&amp;gt;';
}&lt;/code&gt;&lt;/pre&gt;</summary>
    <dc:creator>Manuel Baltieri</dc:creator>
    <dc:date>2020-04-21T12:49:57Z</dc:date>
  </entry>
</feed>
