Multiple data points at same datetime highcharts - highcharts

I am using line chart to plot the graph.
I have multiple data point at same datetime like below.
[[Date.UTC(2015,05,25,03,29), 560], [Date.UTC(2015,05,25,03,29), 548],
[Date.UTC(2015,05,25,03,29), 628], [Date.UTC(2015,05,25,03,29), 740],
[Date.UTC(2015,05,25,03,29), 380], [Date.UTC(2015,05,25,03,29), 548],
[Date.UTC(2015,05,25,03,29), 628], [Date.UTC(2015,05,25,03,29), 740],
[Date.UTC(2015,05,25,03,29), 380], [Date.UTC(2015,05,25,03,29), 548],
[Date.UTC(2015,05,25,03,29), 628], [Date.UTC(2015,05,25,03,29), 740],
[Date.UTC(2015,05,25,03,29), 380], [Date.UTC(2015,05,25,03,29), 548],
[Date.UTC(2015,05,25,03,29), 628], [Date.UTC(2015,05,25,03,29), 740],
[Date.UTC(2015,05,25,03,29), 7740], [Date.UTC(2015,05,25,03,29), 548],
[Date.UTC(2015,05,25,03,29), 628], [Date.UTC(2015,05,25,03,29), 740],
[[Date.UTC(2015,05,25,03,29), 380], [Date.UTC(2015,05,25,19,46), 204],
[Date.UTC(2015,05,25,19,46), -248], [Date.UTC(2015,05,25,19,46), 220],
[Date.UTC(2015,05,25,19,46), -192], [Date.UTC(2015,05,25,19,46), -696],
[Date.UTC(2015,05,25,19,46), -132], [Date.UTC(2015,05,25,19,46), -76],
[Date.UTC(2015,05,25,19,48), 2688], [Date.UTC(2015,05,25,19,49), 1668],
[Date.UTC(2015,05,25,19,49), 788], [Date.UTC(2015,05,25,19,49), 584],
[Date.UTC(2015,05,25,19,49), 100]]
If I plotting above values, i can see only latest values.
for [Date.UTC(2015,05,25,03,29) : 380
for [Date.UTC(2015,05,25,19,46) : -76
for [Date.UTC(2015,05,25,19,49) :100
Also If i download the graph values in excel, it has only above values.
How can i see all the data points at same time in graph also in excel sheet?

Related

Query function in Google Sheet

I am using the below query function but getting an error can anyone help
=QUERY($Q$1:$AD$1,
"SELECT A,COUNT(A)
WHERE A IS NOT NULL
GROUP BY A
PIVOT BY C")
Error -
Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "by" "BY "" at line 4, column 7. Was expecting one of: "true" ... "false" ... "date" ... "timeofday" ... "datetime" ... "timestamp" ... "min" ... "max" ... "avg" ... "count" ... "sum" ... "no_values" ... "no_format" ... "is" ... "null" ... "year" ... "month" ... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ... "with" ... "contains" ... "starts" ... "ends" ... "matches" ... "like" ... "now" ... "dateDiff" ... "quarter" ... "lower" ... "upper" ... "dayOfWeek" ... "toDate" ... ... <INTEGER_LITERAL> ... <DECIMAL_LITERAL> ... <STRING_LITERAL> ... <QUOTED_ID> ... "(" ... "-" ... "min" ... "max" ... "count" ... "avg" ... "sum" ... "year" ... "month" ... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ... "now" ... "dateDiff" ... "lower" ... "upper" ... "quarter" ... "dayOfWeek" ... "toDate" ... "(" ... <STRING_LITERAL> ... <DECIMAL_LITERAL> ... <INTEGER_LITERAL> ... "-" ... "true" ... "false" ... "date" ... "timeofday" ... "datetime" ... "timestamp" ... ... <QUOTED_ID> ... "min" ... "max" ... "avg" ... "count" ... "sum" ... "no_values" ... "no_format" ... "is" ... "null" ... "year" ... "month" ... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ... "with" ... "contains" ... "starts" ... "ends" ... "matches" ... "like" ... "now" ... "dateDiff" ... "quarter" ... "lower" ... "upper" ... "dayOfWeek" ... "toDate" ...
Take out the "BY" after PIVOT. Also, columns A and C aren't in your range so you probably mean Q and S:
=QUERY($Q$1:$AD$1, "SELECT Q,COUNT(Q) WHERE Q IS NOT NULL GROUP BY Q PIVOT S")
You also have the option of making the range into an array by putting curly brackets round it, then using Col1 and Col3:
=QUERY({$Q$1:$AD$1}, "SELECT Col1,COUNT(Col1) WHERE Col1 IS NOT NULL GROUP BY Col1 PIVOT Col3")

How to get a list of map values from a map inside a list?

Let's say I have a list that goes like this!
List<Map<String, String>> names = [
{'name': 'John'},
{'name': 'Adam'},
{'name': 'Sean'},
{'name': 'Shirley'},
{'name': 'Samantha'},
];
How would I be able to retrieve only the list of values inside the map?
I want the output to be this:
List<String> names = [
'John',
'Adam',
'Sean',
'Shirley',
'Samantha',
];
Something like this:
void main() {
List<Map<String, String>> names = [
{'name': 'John'},
{'name': 'Adam'},
{'name': 'Sean'},
{'name': 'Shirley'},
{'name': 'Samantha'},
];
final onlyNames1 = names.map((map) => map.values.first).toList();
final onlyNames2 = names.expand((map) => map.values).toList();
print(onlyNames1); // [John, Adam, Sean, Shirley, Samantha]
print(onlyNames2); // [John, Adam, Sean, Shirley, Samantha]
}

Grails, can not add detail record to master record

I have the following two classes:
class ProdBuffer {
static hasMany = [plannedVolumes: PlannedVolume]
def beforeInsert() {
for (int i=1; i<10; i++) {
addToPlannedVolumes(week:i, volume: 0)
}
}
This part caused the error
/*
weekStart nullable: true,
validator: { val, obj ->
if (obj.id) {
// don't check existing instances
return
}
(val as int) >= obj.getCurrentWeek()}
*/
}
class PlannedVolume {
static belongsTo = [prodBuffer: ProdBuffer]
Integer week
Double volume
}
When I create a new ProdBuffer it should create 9 PlannedVolume records.
But the PlannedBufferController errors when it tries to save ProdBuffer:
Like:
URI
/prodBuffer/save
Class
java.lang.NullPointerException
Message
null
Around line 49 of grails-app\controllers\com\buffer\ProdBufferController.groovy
46: return
47: }
48:
49:>>>> prodBuffer.save flush:true
50:
51: request.withFormat {
52: form multipartForm {
I have also tried to create the plannedVolume before adding it but it gives the same error all time.
STACKTRACE:
Stacktrace follows:
java.lang.reflect.InvocationTargetException: null
at org.grails.core.DefaultGrailsControllerClass$ReflectionInvoker.invoke(DefaultGrailsControllerClass.java:210)
at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:187)
at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)
at grails.plugin.springsecurity.web.UpdateRequestContextHolderExceptionTranslationFilter.doFilter(UpdateRequestContextHolderExceptionTranslationFilter.groovy:64)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.groovy:53)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:158)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.groovy:62)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.groovy:58)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)
at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: null
at org.hibernate.engine.internal.StatefulPersistenceContext.addEntity(StatefulPersistenceContext.java:468)
at org.hibernate.action.internal.AbstractEntityInsertAction.makeEntityManaged(AbstractEntityInsertAction.java:126)
at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:279)
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:254)
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:299)
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:318)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:275)
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:182)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:113)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:192)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:177)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:97)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:73)
at org.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor.onSaveOrUpdate(ClosureEventTriggeringInterceptor.java:81)
at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:651)
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:643)
at org.hibernate.engine.spi.CascadingActions$5.cascade(CascadingActions.java:218)
at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:391)
at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:316)
at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:155)
at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:424)
at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:356)
at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:319)
at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:155)
at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:104)
at org.hibernate.event.internal.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:445)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:281)
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:182)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:113)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:192)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:177)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:97)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:73)
at org.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor.onSaveOrUpdate(ClosureEventTriggeringInterceptor.java:81)
at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:651)
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:643)
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:638)
at org.grails.orm.hibernate.AbstractHibernateGormInstanceApi$_performSave_closure3.doCall(AbstractHibernateGormInstanceApi.groovy:242)
at org.grails.orm.hibernate.GrailsHibernateTemplate.doExecute(GrailsHibernateTemplate.java:243)
at org.grails.orm.hibernate.GrailsHibernateTemplate.execute(GrailsHibernateTemplate.java:187)
at org.grails.orm.hibernate.GrailsHibernateTemplate.execute(GrailsHibernateTemplate.java:110)
at org.grails.orm.hibernate.AbstractHibernateGormInstanceApi.performSave(AbstractHibernateGormInstanceApi.groovy:241)
at org.grails.orm.hibernate.AbstractHibernateGormInstanceApi.save(AbstractHibernateGormInstanceApi.groovy:158)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.save(GormEntity.groovy:151)
at com.buffer.ProdBufferController.$tt__save(ProdBufferController.groovy:49)
at grails.transaction.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:96)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:93)
at grails.transaction.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:96)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:93)
... 37 common frames omitted

Generate tds outside each input field in dart

This is my first question on stackoverflow and i'm totally newbie to dartlang.
I have 8 input fields which i created using this:
InputElement in1 = new InputElement();
in1.placeholder = "№";
InputElement in2 = new InputElement();
in2.placeholder = "Name";
...
InputElement in8 = new InputElement();
in8.placeholder = "Date";
And i couldn't figure out how to automatically generate row with tds containing those input fields. If i create it manually my code would look like this:
InputElement in1 = new InputElement();
in1.placeholder = "№";
TableCellElement cell1 = new Element.td();
cell1.nodes.add(in1);
InputElement in2 = new InputElement();
in2.placeholder = "Name";
TableCellElement cell2 = new Element.td();
cell2.nodes.add(in2);
InputElement in3 = new InputElement();
in3.placeholder = "LastName";
TableCellElement cell3 = new Element.td();
cell3.nodes.add(in3);
InputElement in4 = new InputElement();
in4.placeholder = "Register No";
TableCellElement cell4 = new Element.td();
cell4.nodes.add(in4);
InputElement in5 = new InputElement();
in5.placeholder = "University";
TableCellElement cell5 = new Element.td();
cell5.nodes.add(in5);
InputElement in6 = new InputElement();
in6.placeholder = "Occupation";
TableCellElement cell6 = new Element.td();
cell6.nodes.add(in6);
InputElement in7 = new InputElement();
in7.placeholder = "Grade";
TableCellElement cell7 = new Element.td();
cell7.nodes.add(in7);
InputElement in8 = new InputElement();
in8.placeholder = "Date";
TableCellElement cell8 = new Element.td();
cell8.nodes.add(in8);
TableRowElement tr1 = new Element.tr();
tr1.classes.add("table-header-student");
tr1.nodes.add(cell1);
tr1.nodes.add(cell2);
tr1.nodes.add(cell3);
tr1.nodes.add(cell4);
tr1.nodes.add(cell5);
tr1.nodes.add(cell6);
tr1.nodes.add(cell7);
tr1.nodes.add(cell8);
I don't wanna create it manually cuz i need to do it on other tables with different columns. And the reason i'm creating these input field is to create filtering.
Pls don't suggest innerHtml, appendHtml cuz i have to create it with purely dart code.
I think it's possible to do by making list and using loop but i don't know how. Pls help me!
I'm not sure if I understand your question correctly but I assume this is what you want.
List<String> placeholders = ['№', 'Name', 'LastName', 'Register No', 'University', 'Occupation', 'Grade', 'Date'];
TableRowElement tr = new Element.tr()
..classes.add("table-header-student");
placeholders.forEach((ph) {
tr.append(new TableCellElement()..append(new InputElement()..placeholder = ph));
});
querySelector('table').append(tr);
example with more attributes (not tested)
List<String> fields = [
{'placeholder': '№', 'id': 'id1', 'name': 'name1'},
{'placeholder': 'Name', 'id': 'id2', 'name': 'name2'},
{'placeholder': 'LastName', 'id': 'id3', 'name': 'name3'},
{'placeholder': 'Register No', 'id': 'id4', 'name': 'name4'},
{'placeholder': 'University', 'id': 'id5', 'name': 'name5'},
{'placeholder': 'Occupation', 'id': 'id6', 'name': 'name6'},
{'placeholder': 'Grade', 'id': 'id7', 'name': 'name7'},
{'placeholder': 'Date', 'id': 'id8', 'name': 'name8'}];
TableRowElement tr = new Element.tr()
..classes.add("table-header-student");
fields.forEach((f) {
tr.append(new TableCellElement()..append(
new InputElement()
..placeholder = f['placeholder']
..id = f['id']
..name = f['name']
));
});
querySelector('table').append(tr);
If your element creation logic becomes more complicated I would create a function/method for this
main() {
List<String> fields = [
{'placeholder': '№', 'id': 'id1', 'name': 'name1'},
{'placeholder': 'Name', 'id': 'id2', 'name': 'name2'},
{'placeholder': 'LastName', 'id': 'id3', 'name': 'name3'},
{'placeholder': 'Register No', 'id': 'id4', 'name': 'name4'},
{'placeholder': 'University', 'id': 'id5', 'name': 'name5'},
{'placeholder': 'Occupation', 'id': 'id6', 'name': 'name6'},
{'placeholder': 'Grade', 'id': 'id7', 'name': 'name7'},
{'placeholder': 'Date', 'id': 'id8', 'name': 'name8'}];
TableRowElement tr = new Element.tr()
..classes.add("table-header-student");
fields.forEach((f) {
tr.append(new TableCellElement()..append(createInputElement(f));
});
querySelector('table').append(tr);
}
InputElement createInputElement(Map metadata) {
var ie = new InputElement();
if(metadata['placeholder'] != null) ie.placeholder = metadata['placeholder'];
if(metadata['id'] != null) ie.id = metadata['id'];
if(metadata['name'] != null) ie.name = metadata['name'];
// ... more element customization
return ie;
}

Struts2-jQuery TreeTag showing FreeMarker Error, no tree visible

I am currently trying to get a basic example of struts2-jquery treeTag running.
I have placed this in the JSP :
<sj:head jqueryui="true" customBasepath="css" jquerytheme="jquery_tree_ui" debug="true" />
....
<s:url id="echo" value="http://www.google.com"/>
<sjt:tree
id="treeDynamicAjax"
jstreetheme="apple"
rootNode="theNodes"
nodeHref="%{echo}"
nodeTitleProperty="title"
nodeIdProperty="id"
nodeHrefParamName="echo"
/>
The Java action does this :
private List<TreeNode> theNodes = new ArrayList<TreeNode>();
private String id = "";
public String listUsergroup() {
TreeNode nodeA = new TreeNode();
nodeA.setId("A" + id);
nodeA.setTitle("Node A" + id);
nodeA.setState(TreeNode.NODE_STATE_OPEN);
TreeNode nodeB = new TreeNode();
nodeB.setId("B" + id);
nodeB.setState(TreeNode.NODE_STATE_LEAF);
nodeB.setTitle("Node B" + id);
TreeNode nodeC = new TreeNode();
nodeC.setId("C" + id);
nodeC.setState(TreeNode.NODE_STATE_LEAF);
nodeC.setTitle("Node C" + id);
Collection<TreeNode> children = new ArrayList<TreeNode>();
children.add(nodeB);
children.add(nodeC);
nodeA.setChildren(children);
theNodes.add(nodeA);
return SUCCESS;
}
public List<TreeNode> getTheNodes() {
return theNodes;
}
public void setTheNodes(List<TreeNode> theNodes) {
this.theNodes = theNodes;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
By activating the debug option in struts, I see that theNodes has all the tree.
The problem is that I am getting a yellow-screen-FreeMarker-template error talking about ftl files like template/jquery/treenode-include.ftl or template/jquery/tree.ftl.
It's my first time with jquery-treeTag plugin and in the official documentation I don't find any suitable example (I'd rather not use JSON nor Convention plugin).
If I change rootNode="theNodes" to any other value like rootNode="XXX" I get no exception, but nothing is displayed.
I'm pretty sure that I'm using the <sjt:tree>tag incorrectly, but I can't find any useful doc for a newbie.
Thank you in advance
UPDATE 1 :
This is the FreeMarker error :
FreeMarker template error!
Expression stack.findValue(parameters.nodeTitleProperty) is undefined on line 52, column 35 in template/jquery/treenode-include.ftl.
The problematic instruction: ---------- ==> ${stack.findValue(parameters.nodeTitleProperty)}
[on line 52, column 33 in template/jquery/treenode-include.ftl] in include "/${parameters.templateDir}/jquery/treenode-include.ftl"
[on line 30, column 5 in template/jquery/tree.ftl] ---------- Java backtrace for programmers:
---------- freemarker.core.InvalidReferenceException: Expression stack.findValue(parameters.nodeTitleProperty) is undefined on line 52, column 35 in template/jquery/treenode-include.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
at freemarker.core.Expression.getStringValue(Expression.java:118)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
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.IfBlock.accept(IfBlock.java:82)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.IfBlock.accept(IfBlock.java:82)
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.include(Environment.java:1508)
at freemarker.core.Include.accept(Include.java:169)
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.ConditionalBlock.accept(ConditionalBlock.java:79)
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:259)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:565)
at org.apache.struts2.components.ClosingUIBean.start(ClosingUIBean.java:59)
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:53)
at org.apache.jsp.jsp.administration.listUsergroup_jsp._jspx_meth_sjt_005ftree_005f0(listUsergroup_jsp.java:504)
at org.apache.jsp.jsp.administration.listUsergroup_jsp._jspService(listUsergroup_jsp.java:182)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:374)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:50)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:432)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:322)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:146)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:184)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:155)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
First of all you need to have one root node not a list of root nodes, so change this private List<TreeNode> theNodes = new ArrayList<TreeNode>(); to private TreeNode theNode = new TreeNode();.
Then you can use this code in jsp
<sjt:tree
id="treeDynamicAjax"
jstreetheme="apple"
rootNode="theNode"
nodeHref="%{echo}"
nodeTitleProperty="title"
nodeIdProperty="id"
nodeHrefParamName="echo"
childCollectionProperty="children"
/>
And you do not need id property in your action.

Resources