Passing integers/booleans to a custom component
For some reason, I can pass an object variable or a hard-coded string to a custom component and retrieve it using env.context.component.getParameter, but when I try to pass an integer variable or a hard-coded boolean, it seems to error when it tries to retrieve the parameter and complains about a null value.
This is my call:
<#assign numReplies = (thread.messages.linear.message?size - 1) />
<@component id="Message" message=starter numReplies=numReplies showSubject="true" />
And my retrieving code:
<#attempt>
<#assign showSubject = (env.context.component.getParameter('showSubject') == "true") />
<#recover>
<#assign showSubject = true />
</#attempt>
<#attempt>
<#assign numReplies = env.context.component.getParameter('numReplies') />
<#recover>
<#assign numReplies = 0 /> -- ends up going here because numReplies is null
</#attempt>
Thanks!