tel8618217223380 / jsflot

Automatically exported from code.google.com/p/jsflot
1 stars 1 forks source link

flotChart dows not work correctly inside repeat tags (<a4j:repeat, <ui:repeat, <c:repeat) #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Put flotChart inside <a4j:repeat.
<a4j:repeat var="chartSeries" value="#{someBean.charts}">
<jsflot:flotChart value="#{chartSeries}"                          
chartType="bar">
 </jsflot:flotChart>
</a4j:repeat>
2. Charts is a List<XYDataSetCollection>. 

Expected that several pie charts will be displayed however I see only one. 

Seems this can be fixed by changing a couple of rows in the FlotChartRenderer 
related to IDs and function names generation. 

Thanks

Original issue reported on code.google.com by koshu...@gmail.com on 11 Aug 2009 at 8:16

GoogleCodeExporter commented 9 years ago
Hello, 

Thank you for your interest in JSFlot. I will look into the and get back to 
you. 

Very Best Regards,
Joachim H. Skeie

Original comment by boem...@gmail.com on 11 Aug 2009 at 4:37

GoogleCodeExporter commented 9 years ago
Hello, 

Are you able to use the a4j:repeat attribute rowKeyVar ? 

<a4j:repeat value="#{mybean.items}" var="item" binding="#{mybean.repeater}"
rowKeyVar="repeatVar">
    <jsflot:flotChart id="chart#{rowKeyVar} ... />
</a4j:repeat>

?

Original comment by boem...@gmail.com on 14 Aug 2009 at 10:30

GoogleCodeExporter commented 9 years ago
Hi, 

Yes, I've tried this as well..this approach does not work, seems it does not 
execute 
binding when generates IDs. I've found fix for me. I've created new renderer 
that 
does almost the same that does FlotChartRenderer, the only difference in 
writeComponentContents function in generating ID for chart compoent and 
appropriate 
JS function: 
String clientId = component.getClientId(context);
String id = clientId.replaceAll(":", "_");

I've added replacing since repeat component generates id in following manner: 
"parentID:index:componentId", so in case when we want to generate JS function 
name on 
base of this ID, we need to replace ":" symbol. 

Not sure is it good solution or not, but it works for me so far:)  

Original comment by koshu...@gmail.com on 14 Aug 2009 at 10:51

GoogleCodeExporter commented 9 years ago
Seems like a good fix. I will add this in the 0.7.0 release, which should be 
available within the next two weeks. 

Original comment by boem...@gmail.com on 16 Sep 2010 at 7:34

GoogleCodeExporter commented 9 years ago
Fixed in the 0.7.0 release, available now. Closing Issue. 

Original comment by boem...@gmail.com on 6 Oct 2010 at 7:30