
struts2-jquery - issue #784
Freemarker error if "yaxis" attribute is defined for @sjc.chartData tag
(This is for feature requests and bugs in Struts2 jQuery Plugin - for getting help, please use the User Group. http://groups.google.com/group/struts2-jquery )
What steps will reproduce the problem?
- Add chart tag to Freemarker template, add two chartData into the tag. Define yaxis="1" for the first one and yaxis="2" for the second.
- Open the page is renedered from the template.
What is the expected output? What do you see instead?
The only legal comparisons are between two numbers, two strings, or two dates. Left hand operand is a freemarker.ext.beans.NumberModel Right hand operand is a freemarker.template.SimpleScalar
The problematic instruction:
==> if parameters.yaxis?if_exists != "" [on line 70, column 1 in template/jquery/chart-data.ftl]
Java backtrace for programmers:
freemarker.template.TemplateException: The only legal comparisons are between two numbers, two strings, or two dates. Left hand operand is a freemarker.ext.beans.NumberModel Right hand operand is a freemarker.template.SimpleScalar
at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:182)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.Environment.process(Environment.java:199)
at freemarker.template.Template.process(Template.java:237)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
at org.apache.struts2.components.ClosingUIBean.start(ClosingUIBean.java:59)
at org.apache.struts2.views.freemarker.tags.CallbackWriter.onStart(CallbackWriter.java:73)
Which struts2 version? 2.3.1
Which struts2-jquery plugin version? 3.2.1
Please provide any additional information below.
I think the problematic instructions are <#if parameters.xaxis?if_exists != ""> and <#if parameters.yaxis?if_exists != ""> in jquery-chart-plugin-3.2.1\template\jquery\chart-data.ftl when these lines are replaced with <#if parameters.xaxis?exists> and <#if parameters.yaxis?exists> everything works as expected.
Comment #1
Posted on Mar 2, 2012 by Swift Lion(No comment was entered for this change.)
Comment #2
Posted on Mar 2, 2012 by Swift Lionhttp://code.google.com/p/struts2-jquery/source/detail?r=1623
Can you please try out if the 3.3.0-SNAPSHOT version solves your problem?
Comment #3
Posted on Mar 5, 2012 by Swift OxThe version from 3.3.0-SNAPSHOT completely solves the problem. Thanks a lot!
Comment #4
Posted on Mar 13, 2012 by Swift Lion(No comment was entered for this change.)
Status: Fixed
Labels:
Type-Defect
Priority-Medium
Component-Chart-Plugin
Milestone-3.3.0