0
votes

I have the following function javascript function call.

<script>myFunctionHere({log:true})</script>

I want to check the value of property (checkbox dialog) so I can pass the required value but it's not working.

I tried:

<script>myFunctionHere({log:${properties.logme ? 'true' : 'false'}})</script>

But when I looked at the resulting HTML, it looks like this:

<script>myFunctionHere({log:})</script>

Any ideas how it can be done? Thanks

1

1 Answers

1
votes

As per the specification of HTL language, you need to set an explicit context for expressions inside the script tag:

For style and script contexts, it is mandatory to set a context. If the context isn't set, the expression shouldn't output anything

In your case, you would probably write something like:

<script>myFunctionHere({log:${properties.logme ? 'true' : 'false' @ context='scriptToken'}})</script>