Permission error?
For some reason, when I'm not signed in I can't seem to view my custom component. I get "This widget could not be displayed." I think I've tracked it down to the following lines:
<#attempt>
<#assign pageNum = env.context.component.getParameter('pageNum') />
<#recover>
<#assign pageNum = 1 />
</#attempt>
If I remove the getParameter call, it seems to work fine. I've tried all of the different permissions but it still didn't seem to work. Why isn't this working on non-admin accounts? BTW, all my REST calls use restadmin, so that shouldn't be the issue either.
Hi Bryan,
Without seeing more of the code in context, it's difficult to say exactly what might be causing the error.
One thing I would suggest is setting a default value on the assign, using the default value operator in FreeMarker (http://freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_missing_default). There could be a case where perhaps you're not getting back the value you'd expect from env.context.component.getParameter('pageNum') but if an exception isn't thrown then it wouldn't make it into the recover block and get assigned there. So instead, you might want to try something like this:
<#attempt> <#assign pageNum = env.context.component.getParameter('pageNum')!1 /> <#recover> <#assign pageNum = 1 /> </#attempt>
I hope this helps!