Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Raul Arabaolaza
Accesing Portlet Preferences using Javascript Liferay 6.1.1
16 febbraio 2013 8.37
Risposta

Raul Arabaolaza

Punteggio: New Member

Messaggi: 2

Data di Iscrizione: 16 febbraio 2013

Messaggi recenti

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 febbraio 2013 22.43
Risposta

Chirag Patadia

Punteggio: Junior Member

Messaggi: 29

Data di Iscrizione: 2 febbraio 2012

Messaggi recenti

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 febbraio 2013 3.28
Risposta

Raul Arabaolaza

Punteggio: New Member

Messaggi: 2

Data di Iscrizione: 16 febbraio 2013

Messaggi recenti

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 aprile 2013 9.49
Risposta

Renata Siega

Punteggio: Junior Member

Messaggi: 34

Data di Iscrizione: 29 ottobre 2012

Messaggi recenti

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.