We can handle ajax call through AUI.
Below is the simplest example to achieve this -
<portlet:renderURL var="addEntityURL">
<portlet:param name="jspPage" value="/html/custom/add_entity.jsp"/>
</portlet:renderURL>
<aui:button-row id="<portlet:namespace />custom-button-row">
<aui:script use="aui-button-item">
var buttonRow = A.one("#<portlet:namespace />custom-button-row");
var buttonLabel = "<liferay-ui:message key="add" />";
var contentPane = A.one("#<portlet:namespace/>show-content");
contentPane.plug(A.Plugin.IO, {
uri: '<%=addEntityURL.toString()%>',
autoLoad: false
});
var button = new A.ButtonItem({
icon: 'plusthick',
label: buttonLabel,
handler: function(event) {
contentPane.io.start();
}
}).render(buttonRow);
</aui:script>
</aui:button-row>
<div id="<portlet:namespace />show-content" >
This is the simple text that will be replaced via ajax through AUI
</div>
Below is the simplest example to achieve this -
<portlet:renderURL var="addEntityURL">
<portlet:param name="jspPage" value="/html/custom/add_entity.jsp"/>
</portlet:renderURL>
<aui:button-row id="<portlet:namespace />custom-button-row">
<aui:script use="aui-button-item">
var buttonRow = A.one("#<portlet:namespace />custom-button-row");
var buttonLabel = "<liferay-ui:message key="add" />";
var contentPane = A.one("#<portlet:namespace/>show-content");
contentPane.plug(A.Plugin.IO, {
uri: '<%=addEntityURL.toString()%>',
autoLoad: false
});
var button = new A.ButtonItem({
icon: 'plusthick',
label: buttonLabel,
handler: function(event) {
contentPane.io.start();
}
}).render(buttonRow);
</aui:script>
</aui:button-row>
<div id="<portlet:namespace />show-content" >
This is the simple text that will be replaced via ajax through AUI
</div>