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
How to get selected layout (page) from <liferay-layout: select-layout ../>?
I'm using liferay taglib <liferay-layout:select-layout componentId= ......../> and I want to get selected layout(page) value. How should I do this?
Hi,
You can capture the layout select event and save the selected ids through javascript ,
<liferay-layout:select-layout
itemSelectorSaveEvent='<%= liferayPortletResponse.getNamespace() + "selectLayout" %>'
....
/>
<aui:script>
Liferay.on('<portlet:namespace />selectLayout', function (event) {
console.log(event.data)
});
</aui:script>
Hi Yasin,
Thanks for the answer. It really helps me. I can capture event data in normal JSP but When I use this select-layout on JSP rendered in Pop-up, the same code doesn't work for me. Have you any idea how to capture event data in JSP that rendered in the Pop-up window?
Thanks in advance.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™