1
votes

I am trying to add a local for the date picker and I have the following code in my XPages theme

<resource>
    <content-type>application/x-javascript</content-type>
    <href>#{javascript:return "js/jquery-ui.datepicker_"+view.getLocale()+".js"}</href>
</resource>

unfortunately this gets passed straight through to the browser as a string

< script type="text/javascript" src="whatever.nsf/#%7Bjavascript:return%20%22js/jquery-ui.datepicker_%22+view.getLocale()+%22.js%22%7D" >

How can I get the EL to work? And for that matter because it is in the theme can it even tell at that point what the locale() is ?

1

1 Answers

3
votes

First, I'd recommend using the <resources/> syntax instead. Secondly, instead of a single SSJS expression, try a mixed expression using just standard EL:

<resources>
    <script clientSide="true" src="/js/jquery-ui.datepicker_#{view.locale}.js" />
</resources>