Support non-String attributes to freemarker JSP tag extensions
--------------------------------------------------------------
Key: WW-1830
URL: https://issues.apache.org/struts/browse/WW-1830
Project: Struts 2
Issue Type: Improvement
Components: Views
Affects Versions: 2.0.6
Reporter: Jasper Rosenberg
The full issue and the suggested patch is outlined in this forum post:
http://forums.opensymphony.com/message.jspa?messageID=133951
Here is the original root issue:
---------------------------------------------------
In the docs, it describes being able to pass a parameter directly to the tag
rather than via a a nested param tag
(http://struts.apache.org/2.x/docs/freemarker-tags.html):
<@s.textfield label="First name" name="firstName" description="..."/>
This works great for Strings, but I can't figure out a way to have it work for
booleans.
For example, I added a parameter to controlheader-core.ftl: "excludecolon" so I
can hide the colon after the label (for labels that are questions).
<#if !parameters.excludecolon?default(false)>:</#if><#t/>
If I pass it via a tag:
<@s.param name="excludecolon" value="true"/>
Everything works great.
However, if I try to pass it as an attribute, excludecolon="true", it is
interpreted as a String, and my freemarker template blows up.
None of the following work:
<@s.textfield ...... excludecolon=true/>
<@s.textfield ...... excludecolon="true"/>
<#assign someVar=true />
<@s.textfield ...... excludecolon=someVar/>
<#assign someVar=true />
<@s.textfield .... executecolon="${someVar}" />
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.