Foros de discusión

how to send data from javascript to java page in liferay 6.2

Amit Sinha, modificado hace 9 años.

how to send data from javascript to java page in liferay 6.2

Junior Member Mensajes: 43 Fecha de incorporación: 31/12/14 Mensajes recientes
Hi

in view.jsp of portlet there are 5 labels where every labels have a value
onclick event is added to each label
after clicking any label, javascript is called
now how to send that value (value of label) to a java page

Thanks and Regards
Amit Sinha
thumbnail
Pankaj Kathiriya, modificado hace 9 años.

RE: how to send data from javascript to java page in liferay 6.2

Liferay Master Mensajes: 722 Fecha de incorporación: 5/08/10 Mensajes recientes
Use ajax Refer links. (jQuery ajax, AUI-working with ajax).

You have to call ajax method on dom events to pass values from browser to server side code.
Amit Sinha, modificado hace 9 años.

RE: how to send data from javascript to java page in liferay 6.2

Junior Member Mensajes: 43 Fecha de incorporación: 31/12/14 Mensajes recientes
Thanks Pankaj for replying
but i was unable to call ajax method

can u kindly provide some portlet related ajax link

Thanks and Regards
Amit Sinha
thumbnail
Abhishek Suthar, modificado hace 9 años.

RE: how to send data from javascript to java page in liferay 6.2

New Member Mensajes: 18 Fecha de incorporación: 26/06/13 Mensajes recientes
HI Amit,

Check this out.

https://www.liferay.com/web/tauseef/blog/-/blogs/jquery-ajax-with-liferay
thumbnail
Aditya Bhardwaj, modificado hace 9 años.

RE: how to send data from javascript to java page in liferay 6.2

Junior Member Mensajes: 78 Fecha de incorporación: 8/01/15 Mensajes recientes
Hi Amit,

You can call ajax by using resourceURL you can take help from:-

https://www.liferay.com/web/tauseef/blog/-/blogs/jquery-ajax-with-liferay
http://liferay-blogging.blogspot.in/2012/07/alloyui-how-to-send-ajax-request.html

And remember if you are using 6.2

Add following tags in liferay-portlet.xml
<requires-namespaced-parameters>false</requires-namespaced-parameters>
<ajaxable>true</ajaxable>