Re: [uportal-user] Accessing xml portlet-preference in SimpleJspPortlet

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [uportal-user] Accessing xml portlet-preference in SimpleJspPortlet

JJ Fila
Drew,

Sorry for the delay in replying. Thanks for the tip, I was able to get it to work with the custom preference -- thanks!

- JJ

On Monday, February 11, 2019 at 6:26:35 PM UTC-5, awills wrote:

JJ,

It's completely possible to add arbitrary preferences to a portlet definition and then access them in the JSP that the portlet renders.

IIRC the object that the JSP has access to is called renderRequest, and you can use EL (standard JSP expression syntax) to navigate it's API.

You should consult a reference.  (I'm not going to that just now.)  But, from memory, it's something like...

  ${renderRequest.preferencesMap['prefName'][0]}

where '0' stands for the index you want within the list of values for that preference.

drew

On 2/11/19 10:24 AM, JJ Fila wrote:
Hey all,

Using portal 4.3, just wondering if we could add new prefs to the portlet definition xml like so:

<portlet-preference>
  <name>prefName</name>
  <readOnly>true</readOnly>
  <value>test</value>
</portlet-preference>

And then access it in the corresponding jsp file?

Thanks!
JJ
--
You received this message because you are subscribed to the Google Groups "uPortal Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="tzu1rJKpFgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">uportal-user...@apereo.org.
Visit this group at <a href="https://groups.google.com/a/apereo.org/group/uportal-user/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/a/apereo.org/group/uportal-user/&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/a/apereo.org/group/uportal-user/&#39;;return true;">https://groups.google.com/a/apereo.org/group/uportal-user/.

--
You received this message because you are subscribed to the Google Groups "uPortal Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/uportal-user/.