<?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>how to use Liferay.Util.openModal</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121402560" />
  <subtitle>how to use Liferay.Util.openModal</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121402560</id>
  <updated>2026-04-06T17:16:54Z</updated>
  <dc:date>2026-04-06T17:16:54Z</dc:date>
  <entry>
    <title>RE: RE: how to use Liferay.Util.openModal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121405091" />
    <author>
      <name>Scarletake Bwi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121405091</id>
    <updated>2022-04-22T09:36:51Z</updated>
    <published>2022-04-22T09:36:50Z</published>
    <summary type="html">&lt;p&gt;hi Mohammed&lt;/p&gt;
&lt;p&gt;first, thank you, very, super much.&lt;/p&gt;
&lt;p&gt;it's really help.&lt;/p&gt;
&lt;p&gt;is there any way to make it shows two columns?&lt;/p&gt;
&lt;p&gt;as you can see, in my second.jsp, i put 2 cols in 1 row, but it just
  show 2 rows. or that is the limitation?&lt;/p&gt;
&lt;p&gt;
  &lt;img alt="" height="183"
    src="/documents/14/0/Image+3+%283%29.png/939c5e23-fcf1-1390-7cc3-52076a5eb652?t=1650620160870&amp;amp;imagePreview=1" width="330" /&gt;
  &lt;br /&gt;  &lt;/p&gt;</summary>
    <dc:creator>Scarletake Bwi</dc:creator>
    <dc:date>2022-04-22T09:36:50Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: how to use Liferay.Util.openModal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121404824" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121404824</id>
    <updated>2022-04-22T08:29:30Z</updated>
    <published>2022-04-22T08:29:30Z</published>
    <summary type="html">&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;You may need to fix this with css, either you can provide style to
  that particular jsp or update portal_pop_up.ftl file in your theme.&lt;/p&gt;
&lt;p&gt;Ex. you can add below code in your second.jsp or add required CSS in
  portal_pop_up.flt in theme.&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;lt;style&amp;gt;
	.fieldset  {
		padding:3% !important;
	}
&amp;lt;/style&amp;gt;	&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;. &lt;/p&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2022-04-22T08:29:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: how to use Liferay.Util.openModal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121404580" />
    <author>
      <name>Scarletake Bwi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121404580</id>
    <updated>2022-04-22T01:41:01Z</updated>
    <published>2022-04-22T01:41:01Z</published>
    <summary type="html">&lt;p&gt;hi Mohammed&lt;/p&gt;
&lt;p&gt;sure&lt;/p&gt;
&lt;p&gt;i create a sample mvc bodule&lt;/p&gt;
&lt;p&gt;init.jsp&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;lt;%@ taglib uri=&amp;quot;http://java.sun.com/jsp/jstl/core&amp;quot; prefix=&amp;quot;c&amp;quot; %&amp;gt;

&amp;lt;%@ taglib uri=&amp;quot;http://java.sun.com/portlet_2_0&amp;quot; prefix=&amp;quot;portlet&amp;quot; %&amp;gt;

&amp;lt;%@ taglib uri=&amp;quot;http://liferay.com/tld/aui&amp;quot; prefix=&amp;quot;aui&amp;quot; %&amp;gt;&amp;lt;%@
taglib uri=&amp;quot;http://liferay.com/tld/portlet&amp;quot; prefix=&amp;quot;liferay-portlet&amp;quot; %&amp;gt;&amp;lt;%@
taglib uri=&amp;quot;http://liferay.com/tld/theme&amp;quot; prefix=&amp;quot;liferay-theme&amp;quot; %&amp;gt;&amp;lt;%@
taglib uri=&amp;quot;http://liferay.com/tld/ui&amp;quot; prefix=&amp;quot;liferay-ui&amp;quot; %&amp;gt;

&amp;lt;liferay-theme:defineObjects /&amp;gt;

&amp;lt;portlet:defineObjects /&amp;gt;


&amp;lt;%@ page import=&amp;quot;com.liferay.portal.kernel.util.ListUtil&amp;quot;%&amp;gt;
&amp;lt;%@ page import=&amp;quot;com.liferay.portal.kernel.dao.search.ResultRow&amp;quot;%&amp;gt;
&amp;lt;%@ page import=&amp;quot;com.liferay.portal.kernel.dao.search.SearchEntry&amp;quot;%&amp;gt;
&amp;lt;%@ page import=&amp;quot;com.liferay.portal.kernel.util.ParamUtil&amp;quot;%&amp;gt;
&amp;lt;%@ page import=&amp;quot;com.liferay.portal.kernel.util.WebKeys&amp;quot;%&amp;gt;
&amp;lt;%@ page import=&amp;quot;com.liferay.portal.kernel.language.LanguageUtil&amp;quot;%&amp;gt;
&amp;lt;%@ page import=&amp;quot;com.liferay.portal.kernel.portlet.LiferayWindowState&amp;quot;%&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;view.jsp&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;lt;%@ include file=&amp;quot;/init.jsp&amp;quot; %&amp;gt;
&amp;lt;%
String showEditSnmPrefixDialogJS = &amp;quot;JavaScript:showopenModal('&amp;quot; + 99 + &amp;quot;');&amp;quot;;

%&amp;gt;
		&amp;lt;aui:form id=&amp;quot;test&amp;quot;  method=&amp;quot;post&amp;quot;&amp;gt;
			&amp;lt;aui:fieldset &amp;gt;
			&amp;lt;aui:row&amp;gt;
				&amp;lt;aui:col width=&amp;quot;50&amp;quot;&amp;gt;
						&amp;lt;aui:select name=&amp;quot;select&amp;quot;
							id=&amp;quot;select&amp;quot;
							label=&amp;quot;select&amp;quot; inlineField=&amp;quot;false&amp;quot;&amp;gt;
							&amp;lt;aui:option value=&amp;quot;0&amp;quot; label=&amp;quot;0&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;1&amp;quot; label=&amp;quot;1&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;2&amp;quot; label=&amp;quot;2&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;3&amp;quot; label=&amp;quot;3&amp;quot; /&amp;gt;
						&amp;lt;/aui:select&amp;gt;
				&amp;lt;/aui:col&amp;gt;
				&amp;lt;aui:col width=&amp;quot;50&amp;quot;&amp;gt;
				&amp;lt;aui:select name=&amp;quot;select2&amp;quot; id=&amp;quot;selectid&amp;quot; label=&amp;quot;select2&amp;quot;&amp;gt;
							&amp;lt;aui:option value=&amp;quot;0&amp;quot; label=&amp;quot;Non&amp;quot; selected=&amp;quot;false&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;1&amp;quot; label=&amp;quot;Len&amp;quot; selected=&amp;quot;true&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;2&amp;quot; label=&amp;quot;Gnd&amp;quot; selected=&amp;quot;false&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;3&amp;quot; label=&amp;quot;Ora&amp;quot; selected=&amp;quot;false&amp;quot; /&amp;gt;
						&amp;lt;/aui:select&amp;gt;
				&amp;lt;/aui:col&amp;gt;
				&amp;lt;/aui:row&amp;gt;

				&amp;lt;/aui:fieldset&amp;gt;
	

		&amp;lt;/aui:form&amp;gt;
&amp;lt;liferay-ui:icon  image=&amp;quot;edit&amp;quot; message=&amp;quot;test&amp;quot; url=&amp;quot;&amp;lt;%=showEditSnmPrefixDialogJS%&amp;gt;&amp;quot; /&amp;gt;
	
&amp;lt;portlet:renderURL var=&amp;quot;openModal&amp;quot; windowState=&amp;quot;&amp;lt;%=LiferayWindowState.POP_UP.toString()%&amp;gt;&amp;quot;&amp;gt;
	&amp;lt;portlet:param name=&amp;quot;mvcPath&amp;quot; value=&amp;quot;/second.jsp&amp;quot;/&amp;gt;
&amp;lt;/portlet:renderURL&amp;gt;
&amp;lt;aui:script position=&amp;quot;inline&amp;quot; use=&amp;quot;aui-base&amp;quot;&amp;gt;
window.showopenModal = function(id) {
		
		Liferay.Util.openModal(
			{
				title: 'test',
				centered: true,
                constrain2view: false,
                modal: true,
                height: 650,
				resizable: true,
				url: '&amp;lt;%=openModal.toString()%&amp;gt;&amp;amp;&amp;lt;portlet:namespace /&amp;gt;targetPart='+id,
				size: 'md'
			}
		);

		
}
&amp;lt;/aui:script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;the second.jsp&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;lt;%@include file=&amp;quot;/init.jsp&amp;quot;%&amp;gt;
&amp;lt;%
	String partNumber = ParamUtil.getString(request, &amp;quot;targetPart&amp;quot;);
%&amp;gt;


		&amp;lt;aui:form id=&amp;quot;test&amp;quot;  method=&amp;quot;post&amp;quot;&amp;gt;
			&amp;lt;aui:fieldset &amp;gt;
			&amp;lt;aui:row&amp;gt;
				&amp;lt;aui:col width=&amp;quot;50&amp;quot;&amp;gt;
						&amp;lt;aui:select name=&amp;quot;select&amp;quot;
							id=&amp;quot;select&amp;quot;
							label=&amp;quot;select&amp;quot; inlineField=&amp;quot;false&amp;quot;&amp;gt;
							&amp;lt;aui:option value=&amp;quot;0&amp;quot; label=&amp;quot;0&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;1&amp;quot; label=&amp;quot;1&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;2&amp;quot; label=&amp;quot;2&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;3&amp;quot; label=&amp;quot;3&amp;quot; /&amp;gt;
						&amp;lt;/aui:select&amp;gt;
				&amp;lt;/aui:col&amp;gt;
				&amp;lt;aui:col width=&amp;quot;50&amp;quot;&amp;gt;
				&amp;lt;aui:select name=&amp;quot;select2&amp;quot; id=&amp;quot;selectid&amp;quot; label=&amp;quot;select2&amp;quot;&amp;gt;
							&amp;lt;aui:option value=&amp;quot;0&amp;quot; label=&amp;quot;Non&amp;quot; selected=&amp;quot;false&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;1&amp;quot; label=&amp;quot;Len&amp;quot; selected=&amp;quot;true&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;2&amp;quot; label=&amp;quot;Gnd&amp;quot; selected=&amp;quot;false&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;3&amp;quot; label=&amp;quot;Ora&amp;quot; selected=&amp;quot;false&amp;quot; /&amp;gt;

						&amp;lt;/aui:select&amp;gt;
				&amp;lt;/aui:col&amp;gt;
				&amp;lt;/aui:row&amp;gt;

				&amp;lt;/aui:fieldset&amp;gt;
	

		&amp;lt;/aui:form&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Scarletake Bwi</dc:creator>
    <dc:date>2022-04-22T01:41:01Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: how to use Liferay.Util.openModal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121403786" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121403786</id>
    <updated>2022-04-20T19:08:52Z</updated>
    <published>2022-04-20T19:08:51Z</published>
    <summary type="html">&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;Can you please share the updated code used for creating AUI pop up.&lt;/p&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2022-04-20T19:08:51Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: how to use Liferay.Util.openModal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121403354" />
    <author>
      <name>Scarletake Bwi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121403354</id>
    <updated>2022-04-20T15:17:43Z</updated>
    <published>2022-04-20T15:17:42Z</published>
    <summary type="html">&lt;p&gt;hi &lt;/p&gt;
&lt;p&gt;thank you for reply.&lt;/p&gt;
&lt;p&gt;i tried, change from openModal to openWindow, and cahnge from url to
  uri, but doesn't work.&lt;/p&gt;</summary>
    <dc:creator>Scarletake Bwi</dc:creator>
    <dc:date>2022-04-20T15:17:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: how to use Liferay.Util.openModal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121403062" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121403062</id>
    <updated>2022-04-22T09:30:31Z</updated>
    <published>2022-04-20T14:15:16Z</published>
    <summary type="html">&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;Open Window is normally used for rendering a jsp and performing
  action inside it , Open Modal will open div for html content.&lt;/p&gt;
&lt;p&gt;You can refer below link for detail and example&lt;/p&gt;
&lt;p&gt;
  &lt;a href="https://www.liferaystack.com/2017/09/aui-popup-and-aui-modal-dialog-in-liferay-7.html"&gt;https://www.liferaystack.com/2017/09/aui-popup-and-aui-modal-dialog-in-liferay-7.html &lt;/a&gt;&lt;/p&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2022-04-20T14:15:16Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: how to use Liferay.Util.openModal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121402879" />
    <author>
      <name>Scarletake Bwi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121402879</id>
    <updated>2022-04-20T14:00:27Z</updated>
    <published>2022-04-20T14:00:27Z</published>
    <summary type="html">&lt;p&gt;hi &lt;/p&gt;
&lt;p&gt;thank you for reply&lt;/p&gt;
&lt;p&gt;but i have add&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;lt;%@include file=&amp;quot;/init.jsp&amp;quot;%&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in my modal page, and other object such like java.util.List had included.&lt;/p&gt;
&lt;p&gt;could you please explain what different between openWindow and openModal?&lt;/p&gt;</summary>
    <dc:creator>Scarletake Bwi</dc:creator>
    <dc:date>2022-04-20T14:00:27Z</dc:date>
  </entry>
  <entry>
    <title>RE: how to use Liferay.Util.openModal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121402388" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121402388</id>
    <updated>2022-04-22T09:30:29Z</updated>
    <published>2022-04-20T08:01:48Z</published>
    <summary type="html">&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;This would be because AUI taglib is not loaded in your modal page ,
  you can include aui taglib in your popup jsp and also try opening
  modal with Liferay.Util.openWindow&lt;br /&gt;
  &lt;br /&gt;  &lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;Liferay.Util.openWindow(
            {
                dialog: {
                    destroyOnHide: true,
                },
                title: 'PopUp Page',
                uri: '&amp;lt;%=popupURL.toString()%&amp;gt;'
            }
        );&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2022-04-20T08:01:48Z</dc:date>
  </entry>
  <entry>
    <title>how to use Liferay.Util.openModal</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121402559" />
    <author>
      <name>Scarletake Bwi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121402559</id>
    <updated>2022-04-20T03:07:34Z</updated>
    <published>2022-04-20T03:07:33Z</published>
    <summary type="html">&lt;p&gt;hi &lt;/p&gt;
&lt;p&gt;i try create a popup window in my portlet, like &amp;quot;sign in&amp;quot;&lt;/p&gt;
&lt;p&gt;
  &lt;img alt="" height="270"
    src="/documents/14/0/Image+1+%284%29.png/f7423115-3818-0817-8e03-3226fb11a017?t=1650423672857&amp;amp;imagePreview=1" width="348" /&gt;
  &lt;br /&gt;  &lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;lt;aui:script position=&amp;quot;inline&amp;quot; use=&amp;quot;aui-base&amp;quot;&amp;gt;
window.showSnmUploadWuFileDialogJS2 = function(id) {
		
		Liferay.Util.openModal(
			{
				title: '&amp;lt;%=descriptionUploadWUFile%&amp;gt;',
				centered: true,
                modal: true,
                height: 650,
				url: '&amp;lt;%=uploadWuURL.toString()%&amp;gt;&amp;amp;&amp;lt;portlet:namespace /&amp;gt;targetOrderNumber='+id,
				size: 'md'
			}
		);

		
}
&amp;lt;/aui:script&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;		&amp;lt;aui:form id=&amp;quot;test&amp;quot;  method=&amp;quot;post&amp;quot;&amp;gt;
			&amp;lt;aui:fieldset &amp;gt;
			&amp;lt;aui:row&amp;gt;
				&amp;lt;aui:col &amp;gt;
						&amp;lt;aui:select name=&amp;quot;select&amp;quot;
							id=&amp;quot;select&amp;quot;
							label=&amp;quot;select&amp;quot; inlineField=&amp;quot;false&amp;quot;&amp;gt;
							&amp;lt;aui:option value=&amp;quot;0&amp;quot; label=&amp;quot;0&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;1&amp;quot; label=&amp;quot;1&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;2&amp;quot; label=&amp;quot;2&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;3&amp;quot; label=&amp;quot;3&amp;quot; /&amp;gt;
						&amp;lt;/aui:select&amp;gt;
				&amp;lt;/aui:col&amp;gt;
				&amp;lt;aui:col &amp;gt;
				&amp;lt;aui:select name=&amp;quot;select2&amp;quot; id=&amp;quot;selectid&amp;quot; label=&amp;quot;select2&amp;quot;&amp;gt;
							&amp;lt;aui:option value=&amp;quot;0&amp;quot; label=&amp;quot;Non&amp;quot; selected=&amp;quot;false&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;1&amp;quot; label=&amp;quot;Len&amp;quot; selected=&amp;quot;true&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;2&amp;quot; label=&amp;quot;Gnd&amp;quot; selected=&amp;quot;false&amp;quot; /&amp;gt;
							&amp;lt;aui:option value=&amp;quot;3&amp;quot; label=&amp;quot;Ora&amp;quot; selected=&amp;quot;false&amp;quot; /&amp;gt;

						&amp;lt;/aui:select&amp;gt;
				&amp;lt;/aui:col&amp;gt;
				&amp;lt;/aui:row&amp;gt;

				&amp;lt;/aui:fieldset&amp;gt;
	

		&amp;lt;/aui:form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but it shows&lt;/p&gt;
&lt;p&gt;
  &lt;img alt="" height="266"
    src="/documents/14/0/Image+2+%284%29.png/39917783-a5dd-39ac-0894-308f9c03c8b1?t=1650423752443&amp;amp;imagePreview=1" width="376" /&gt;&lt;/p&gt;
&lt;p&gt;All components are close to the frame, no space is left, it looks ugly&lt;/p&gt;
&lt;p&gt;how to make it display just like in normal jsp page?&lt;/p&gt;
&lt;p&gt;thanks in advance&lt;/p&gt;</summary>
    <dc:creator>Scarletake Bwi</dc:creator>
    <dc:date>2022-04-20T03:07:33Z</dc:date>
  </entry>
</feed>
