<?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>Liferay 7.2 - Get attribute on doView after setting it on javascript</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117285693" />
  <subtitle>Liferay 7.2 - Get attribute on doView after setting it on javascript</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117285693</id>
  <updated>2026-04-03T14:16:30Z</updated>
  <dc:date>2026-04-03T14:16:30Z</dc:date>
  <entry>
    <title>RE: Liferay 7.2 - Get attribute on doView after setting it on javascript</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117288715" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117288715</id>
    <updated>2019-09-26T12:21:00Z</updated>
    <published>2019-09-26T12:21:00Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&lt;br&gt;You can get the parameter in doView either in two ways&lt;br&gt;&amp;nbsp;1. set&amp;nbsp; attribute with prefix portlet namespace&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;pre&gt;&lt;code&gt;var data = {'&amp;lt;portlet:namespace /&amp;gt;param1': value}; &lt;/code&gt;&lt;/pre&gt;then you can fetch using&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;ParamUtil.getString(renderRequest, "param1");&lt;/code&gt;&lt;/pre&gt;2. Without setting namespace you can fetch directly using HttpServletRequest&amp;nbsp;&lt;br&gt;&lt;pre&gt;&lt;code&gt;var data = {'param1': value};

PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(renderRequest)).getParameter("param1")&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-09-26T12:21:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.2 - Set attribute on javascript</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117285136" />
    <author>
      <name>Fabio Carvalho</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117285136</id>
    <updated>2019-09-26T10:42:52Z</updated>
    <published>2019-09-26T10:42:52Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;It seems that I can get the value on my doView method if I so something like this:&lt;br&gt;&lt;pre&gt;&lt;code&gt;UploadPortletRequest test = PortalUtil.getUploadPortletRequest(renderRequest);
System.out.println(test.getParameter("param1"));&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;But doing like this I get the following WARN:&lt;pre&gt;&lt;code&gt;WARN &amp;amp;nbsp;[http-nio-8080-exec-10][UploadServletRequestImpl:242] Unable to parse upload request: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;​​​​​​​&lt;/strong&gt;&lt;br&gt;Ok, seems that doing like this, I can get the value without the warning:&lt;br&gt;&lt;pre&gt;&lt;code&gt;HttpServletRequest test = PortalUtil.getHttpServletRequest(renderRequest);
test = PortalUtil.getOriginalServletRequest(test);
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;
System.out.println(test.getParameter("param1"));&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Still not sure if this is the correct way to do this...&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fabio Carvalho</dc:creator>
    <dc:date>2019-09-26T10:42:52Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7.2 - Get attribute on doView after setting it on javascript</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117285692" />
    <author>
      <name>Fabio Carvalho</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117285692</id>
    <updated>2019-09-25T16:18:21Z</updated>
    <published>2019-09-25T16:18:21Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&lt;br&gt;&lt;br&gt;I have a custom portlet with another portlet embedded:&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;%@ include file="/init.jsp" %&amp;amp;gt;

&amp;lt;aui:select name="testId"&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;aui:option value="100"&amp;gt;Test 100&amp;lt;/aui:option&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;aui:option value="200"&amp;gt;Test 200&amp;lt;/aui:option&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;aui:option value="300"&amp;gt;Test 300&amp;lt;/aui:option&amp;gt;
&amp;lt;/aui:select&amp;gt;
&amp;lt;liferay-portlet:runtime portletName="Importer_INSTANCE_TEST" /&amp;gt;

&amp;lt;aui:script&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;AUI().ready('aui-dialog', 'node' , function(A) {
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;A.one("#&amp;lt;portlet:namespace /&amp;gt;testId").on('change', function(e) {
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;    var data = {'param1': this.val()};
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;Liferay.Portlet.refresh('#p_p_id_Importer_INSTANCE_TEST_', data);
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;});
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;});
&amp;lt;/aui:script&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;What this is producing is: a simple select with 3 options, and when the user selects an option, the javascript is called and the&amp;nbsp;&lt;span style="font-size: 16px;"&gt;embedded portlet is refreshed with the value of the selected option. Now, I want to get this value on my doView method of the refreshed portlet (&lt;/span&gt;&lt;span style="font-size: 16px;"&gt;Importer_INSTANCE_TEST). How should I do this?&lt;/span&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fabio Carvalho</dc:creator>
    <dc:date>2019-09-25T16:18:21Z</dc:date>
  </entry>
</feed>
