Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Lior Hadaya
Liferay.Service.Portal.getLayoutName in Javascript
14 de noviembre de 2012 1:14
Respuesta

Lior Hadaya

Ranking: Regular Member

Mensajes: 138

Fecha de incorporación: 24 de enero de 2012

Mensajes recientes

Hello,

I'm using Liferay EE 6.1.20 and I'm trying to get the name of the current layout using Javascript.
I tried to use the getLayoutName method but the callback receives null as the result:
1
2var params = {};
3var layout;
4Liferay.Service.Portal.Layout.getLayoutName(params, function(p) {
5    layout = p;
6});

I tried to debug the service call and didn't see anything unusual, it seems that Liferay does send a request and gets a response back, just without the name of the layout..

Can you please tell me what I'm doing wrong?

Thanks,

Lior
Juan Gonzalez
RE: Liferay.Service.Portal.getLayoutName in Javascript
14 de noviembre de 2012 2:43
Respuesta

Juan Gonzalez

LIFERAY STAFF

Ranking: Liferay Legend

Mensajes: 2947

Fecha de incorporación: 28 de octubre de 2008

Mensajes recientes

Did you check what are the needed params for that method? Probably you have to provide a param (for example, current plid).
Lior Hadaya
RE: Liferay.Service.Portal.getLayoutName in Javascript
14 de noviembre de 2012 3:09
Respuesta

Lior Hadaya

Ranking: Regular Member

Mensajes: 138

Fecha de incorporación: 24 de enero de 2012

Mensajes recientes

I haven't been able to find official documentation for the method (or any of Liferay's Javascript API for that matter).
According to the browser console, the method expects to get two parameters - params object and a callback. I have no idea if I need to set any data inside the params object.