RE: How to navigate jsp other jsp from JavaScript method

thumbnail
تم تعديل Ramalingaiah. D منذ 7 سنوات من الدقائق. Expert المشاركات: 489 تاريخ الإنضمام: 16‏/8‏/14 المشاركات الحديثة
Hi,

   We are currently using the following code to navigate to another jsp on click of button:
  <aui:button onclick="<%= addEntryURL.toString() %>" value="Create Expense"></aui:button>

We need to call a javascript method inside jsp on click of button which will then navigate to different jsp .


Thank you
​​​​​​​Ram
thumbnail
تم تعديل Gnaniyar Zubair منذ 7 سنوات من الدقائق. Liferay Master المشاركات: 724 تاريخ الإنضمام: 19‏/12‏/07 المشاركات الحديثة
HI,

Remove onClick and call javascript method where you can redirect to another jsp:

 
<portlet:renderurl var="redirectURL" />

<script>
function redirect() {

window.location.href = '${redirectURL}';
}
</script>


OR

​​​​​​​document.frm.action = "&lt;%=redirectURL.toString() %&gt;"; 
document.frm.submit();

HTH
thumbnail
تم تعديل Ramalingaiah. D منذ 7 سنوات من الدقائق. Expert المشاركات: 489 تاريخ الإنضمام: 16‏/8‏/14 المشاركات الحديثة
Dear Gnaniyar,

thank you so-mach ,

it is working fine now.

Thank you
Ram