Fórumok
Liferay.Service.Portal.getLayoutName in Javascript
Lior Hadaya, módosítva 11 év-val korábban
Liferay.Service.Portal.getLayoutName in Javascript
Regular Member Bejegyzések: 138 Csatlakozás dátuma: 2012.01.24. Legújabb bejegyzések
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:
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
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:
var params = {};
var layout;
Liferay.Service.Portal.Layout.getLayoutName(params, function(p) {
layout = p;
});
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 P, módosítva 11 év-val korábban
RE: Liferay.Service.Portal.getLayoutName in Javascript
Liferay Legend Bejegyzések: 3089 Csatlakozás dátuma: 2008.10.28. Legújabb bejegyzések
Did you check what are the needed params for that method? Probably you have to provide a param (for example, current plid).
Lior Hadaya, módosítva 11 év-val korábban
RE: Liferay.Service.Portal.getLayoutName in Javascript
Regular Member Bejegyzések: 138 Csatlakozás dátuma: 2012.01.24. Legújabb bejegyzések
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.
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.