Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Raul Arabaolaza
Accesing Portlet Preferences using Javascript Liferay 6.1.1
16 de Fevereiro de 2013 08:37
Resposta

Raul Arabaolaza

Ranking: New Member

Mensagens: 2

Data de entrada: 16 de Fevereiro de 2013

Mensagens recentes

Hi,

I´m completely new to Liferay Development so this is probably a stupid question. I need to access my Portlet non static preferences values by using Javascript.

After searching the web I´ve found that the Liferay Service PorletPreferences doesn´t allow me to read values, and haven´t found any other service related to Portlet preferences.

I´ve also found that Preferences are stored in the PorletPreferences table in database, but I´ve not found any way of querying that table with javascript using Liferay services

So, any hint in how can I access Portlet dinamic preferences in javascript?

Regards
Chirag Patadia
RE: Accesing Portlet Preferences using Javascript Liferay 6.1.1
16 de Fevereiro de 2013 22:43
Resposta

Chirag Patadia

Ranking: Junior Member

Mensagens: 29

Data de entrada: 2 de Fevereiro de 2012

Mensagens recentes

Hi Raul,

You can try with below code snippet. That might solve your problem.

preferences = Packages.com.liferay.portal.util.PrefsPropsUtil.getPreferences();
value = preferences.getValue("<<preference key>>", null);
Raul Arabaolaza
RE: Accesing Portlet Preferences using Javascript Liferay 6.1.1
17 de Fevereiro de 2013 03:28
Resposta

Raul Arabaolaza

Ranking: New Member

Mensagens: 2

Data de entrada: 16 de Fevereiro de 2013

Mensagens recentes

Hi Chiraq,

Thanks for the answer, unfortunately your code seems to work only when using the services administrative console, I need the javascript code to be executed by my portlet, JSP directives are not an option either.

Currently I´m thinking about creating a custom service using ServiceBuilder.

Thanks again, Raúl
Renata Siega
RE: Accesing Portlet Preferences using Javascript Liferay 6.1.1
19 de Abril de 2013 09:49
Resposta

Renata Siega

Ranking: Junior Member

Mensagens: 34

Data de entrada: 29 de Outubro de 2012

Mensagens recentes

Raul, did you find another way to retrieve the portlet preferences or have to create a custom service using ServiceBuilder? I'm stuck on that too.