cancel
Showing results for 
Search instead for 
Did you mean: 

Using JSTL functions in custom EL for Tab Activation

Mathilde_Viveri
Confirmed Champ
Confirmed Champ

Hello,

I am trying to set my tab activation so that it appears only for product having a specific field starting by a specific string.

For example, I would like the tab to appear only when the dc:title starts with "Prod", here is what I tried:

'#{fn:startsWith(currentDocument.dc.title, "Prod"}

when I try it, i get on my server logs: "function fn:startsWith not found"

Would have any idea of how I could achieve this ?

Thanks for your answers

1 ACCEPTED ANSWER

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

Functions are not supported in this context, see https://jira.nuxeo.com/browse/NXP-13680. As a workaround, for your example, the following should work ok (not tested):

'#{currentDocument.dc.title.startsWith(“Prod”)}

As an alternative, or if your logics are too complex, you can define a Seam component in a custom bundle and call the corresponding methods, as Seam components are available in this context.

View answer in original post

2 REPLIES 2

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

Functions are not supported in this context, see https://jira.nuxeo.com/browse/NXP-13680. As a workaround, for your example, the following should work ok (not tested):

'#{currentDocument.dc.title.startsWith(“Prod”)}

As an alternative, or if your logics are too complex, you can define a Seam component in a custom bundle and call the corresponding methods, as Seam components are available in this context.

Mathilde_Viveri
Confirmed Champ
Confirmed Champ

Well I thought I already tried this syntax... I re-tried, and it's working with '#{currentDocument.dc.title.startsWith("Prod")}