srividya_sharma

Fusion Charts intergration with JSF

Recommended Posts

yes, I did that.

<head>

<%

response.setHeader("Cache-Control","no-cache"); //HTTP 1.1

response.setHeader("Pragma","no-cache"); //HTTP 1.0

response.setDateHeader ("Expires", 0);

%>

</head>

but it didn't help me. :(

Share this post


Link to post
Share on other sites

hey Srividya,

I have emailed you that I tried to add those lines and it has not worked. It is not giving any error as well. Is there any other way to debug this?

Thanks.

Share this post


Link to post
Share on other sites

Hi Karani,

I was able to replicate the problem here, with the given code snippets.

Here is one solution that works. Just change the switchType of the tabPanel as follows:

<rich:tabPanel id="defaultTabPanel" switchType="client">

At this point of time, I am unable to clarify why in the default switchType, JSF Component receives null values. I will explore more on this and try to find other solutions.

Hope the current solution works for you. :(

Srividya

Share this post


Link to post
Share on other sites

Hi,

I have found the solution for switchType "normal" also. Basically, when the tab is clicked and the tabPanel switchType is "normal", it gets the state from the server.

The tag library was not saving the state in the server. I have now fixed this issue in the taglib.

Now your tabs will work like a charm! :(

regards,

Srividya

fusionchartstaglibJSF1-2.zip

Edited by Guest

Share this post


Link to post
Share on other sites

Thanks Srividya. I took your latest taglib.jar and tested my code and it worked fine. Thanks so much for your help. I was using static XML all this while, now I will code to get data from database and test it out.

thanks once again.

Share this post


Link to post
Share on other sites

Hi Srividya, I have been using your taglib.jar for Fusion Chart integration with JSF. HOw will I get notified if at all you release newer version of the same jar file? Please advise. Also, I am using backing bean method, so using fc.render tag in my page. Does the attribute filename get excuted/parsed before xml attribute? It is allowing me to write in whcihever order I want, but I noticed that filename is parsed before xml. Is there anyway to change the rule or its fixed?

Please advise.

Thanks.

Share this post


Link to post
Share on other sites

Whenever a new jar is released, it will be posted in this forum only. Please subscribe to this topic and you will get notification of any new post. ( Topic Options > Subscribe to Topic > Email Notification )

Yes, the attributes can be specified in any order, since each attribute is independent of the other.

Why do you want the xml to be parsed before the filename?

regards

Srividya

Share this post


Link to post
Share on other sites

Hi

 

Can we use fusion chart with XML data hard-coded ?

 

I used it in a portlet seam + jsf + facelets + richfaces environment.

 

 

 

I have following code in index.xhtml :

 

 

 

 

 

< rich:panel header="Fusion Chart">

 

< fc:renderHTML chartId="SimpleChart" filename="../FusionCharts/FCF_Column3D.swf" width="700" height="300">

 

< graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'>

 

< a4j:repeat value="#{profilForm.donnesProfilDTO}"

 

var="item">

 

< set name="#{item.date}" value="#{item.value}" color='AFD8F8' />

 

< /a4j:repeat>

 

< /graph>

 

< /fc:renderHTML>

 

< /rich:panel>

 

 

 

 

 

And i have the following result source code HTML :

 

 

 

< graph caption="Monthly Unit Sales" xAxisName="Month" yAxisName="Units" decimalPrecision="0" formatNumberScale="0">

 

< set name="01/04/2009" value="1.1690696" color="AFD8F8">< /set>

 

< set name="02/04/2009" value="1.1293269" color="AFD8F8">< /set>

 

< set name="03/04/2009" value="1.1101601" color="AFD8F8">< /set>

 

< set name="04/04/2009" value="1.13291" color="AFD8F8">< /set>

 

< set name="05/04/2009" value="1.1210927" color="AFD8F8">< /set>

 

< set name="06/04/2009" value="1.1244303" color="AFD8F8">< /set>

 

< set name="07/04/2009" value="1.1261009" color="AFD8F8">< /set>

 

< set name="08/04/2009" value="1.1606312" color="AFD8F8">< /set>

 

< /graph>

 

< param name="FlashVars" value="&chartWidth=700&chartHeight=300&debugMode=0&dataURL=null" />

 

 

 

The "dataURL" is null ...

 

Does we change the taglib ?

 

Sorry for my english =/

Share this post


Link to post
Share on other sites

Hi

 

I am using ICEfaces 1.8.0 with Facelets. I was trying to run chart examples on my Ubuntu but somehow it doesn't work. Just blank page appears.

 

 

 

I attatched jsf code and output.

 

 

 

I woud be grateful for any suggestions

 

 

 

Mariusz

temp.txt

page_source.txt

Share this post


Link to post
Share on other sites

Hi Srividya, I have a filename value which gets set when xml attribute it parsed...during in getXml method. If you are saying that each attribut eis independent of other, then in my situation xml should get parsed first because I am putting that attribute before filename in my fc:render tag. Does it make sense?

Thanks for your help.

Share this post


Link to post
Share on other sites

Hi Karani,

The filename attribute of fc:render tag represents the name of the swf file. Are you talking about this attribute? If that is the case, then I think the name of the swf file is independent of the xml.

Need more clarity.

Share this post


Link to post
Share on other sites

I request all users of this thread to create new topic for individual problems that you face related to FusionCharts with JSF.

This topic is growing and it might be difficult for future users to understand what is going on.

Thanks a lot :(

Share this post


Link to post
Share on other sites

Hi Srividya, I am talking about the fileName attribute of fc:render tag, which contains the name of swf file. I use a bean method to get the fileName and in the bean, this fileName is set while getXml method is executed. Basically, swf file name is not hardcoded, which swf file name should be passed is decided by getXml method. There are certain class level variables whcih are populated in bean methods. so, in getXml method, before returning xmlString, setChartFileName() is executed in the bean. And that will set Chart File Name as some swf file name. Then I have fileName attribute, filename="#{backingBean.chartFileName}". And in backingBean I have getChartFileName() method which returns fileName by prefixing with - (FacesContext.getCurrentInstance().getExternalContext()).getRequestContextPath()

And because of this kind of dynamic setting of attributes, I wanted to make sure that attributes get parsed in the order that they are written.

Thanks for all your help. Let me know if this topic needs to be moved to some other topic.

Share this post


Link to post
Share on other sites

Hi Karani,

The setting of the attribute values is done internally by JSF and I have verified that it is done in the order in which they are provided.

So your filename will get set correctly.

If you want to post more queries in this regard, you can start a new topic. Thanks.

Share this post


Link to post
Share on other sites

Hi,

I have used fusionchartstaglibJSF1_1.jar jar.But getting the following error.

java.lang.NoClassDefFoundError: javax/faces/webapp/UIComponentELTag
When i debugged i found that UIComponentELTag is available in jsf-api.jar.It is not present in myfaces-api-1.1.5.jar which we are currently using.
UIComponentELTag is present in myfaces-api-1.2.jar which does not support usage of Trinidad 1.0.Please advise.
Binamra

Share this post


Link to post
Share on other sites

Hi Binamra Binay

fusionchartstaglibJSF1_1.jar is meant for JSF 1.1 which does not contain the UIComponentELTag. This jar will work with Trinidad.

fusionchartstaglibJSF1-2.jar is meant for JSF 1.2 and the jar internally uses UIComponentELTag.

Please check that you do not have both the jar files in your classpath and your web server is picking the 1.2 jar.

Hope this solves the problem.

Share this post


Link to post
Share on other sites

Thanks for your help.I am able to see the examples in the JSF pages.

I am trying to plot a PIE 3D chart/I am getting the data from the backing bean.But not able to see the chharts.

JSF code which i am using :

<

fc:render chartId="#{exampleChartData.chartId}" filename="../../FusionCharts/FCF_Pie3D.swf" debugMode="true">#{exampleChartData.xml}</fc:render>

From the backing bean i am getting the following response.

<chart caption='Company Revenue' showPercentageValues='1'><set label='France' value='17'/><set label='India' value='12'/><set label='Brazil' value='18'/><set label='USA' value='8'/><set label='Australia' value='10'/><set label='Japan' value='16'/><set label='England' value='11' /><set label='Nigeria' value='12' /><set label='Italy' value='8' /><set label='China' value='10' /><set label='Canada' value='19'/><set label='Germany' value='15'/></chart>

Am i doing something wrong here ?

Share this post


Link to post
Share on other sites

Hi Binamra Binay

You seem to be using the free version of FusionCharts. ( FCF_Pie3D )

<chart> tag is recognized by v3 paid version. Please replace this with <graph> tag.

Also, <set label=...> should be changed to <set name=...> 

If you are using the free version, please refer to documentation that came along with the download package for the correct xml tags and attributes.

This will work out.:(

Share this post


Link to post
Share on other sites
Hi,

Thanks to the Forum Moderator. I am able to completely integrate Fusion chart with MyFaces (Trinidad 1.0).

However i am having a very strange issue.3D Pie charts are being shown in the Firefox/Chrome browser.But it gets loaded sometimes in IE7.0.Not always. I have Adobe Flash Player 10 installed.

Can someone tell me what is the issue ?

Share this post


Link to post
Share on other sites
srividya_sharma (4/12/2009)
Hi,

 

 

 

I have found the solution for switchType "normal" also. Basically, when the tab is clicked and the tabPanel switchType is "normal", it gets the state from the server.

 

 

 

The tag library was not saving the state in the server. I have now fixed this issue in the taglib.

 

 

 

Now your tabs will work like a charm! :(

 

 

 

regards,

 

 

 

Srividya

 

 

 

Hello srividya, thank you very much for making the taglib, It's pretty usefull :(.

 

 

 

Does it work with FusionMaps?. The documentation says we have to use FusionMaps.js instead of FusionCharts.js (but I don't know if the scripts are equivalent).

 

 

 

If the taglib doesn't work with FusionMaps could update it to make it work or post the source of the latest version so I can try to update it (I've never made a taglib but I can investigate how to do it, if you post the code I would tank you to you point me to the right place to start learning).

 

 

 

Edit: I'm using your taglib in aportlet environment (Liferay + ICEfaces) and it works fine... unless I put two or more portlets on the same page, seems that the div generadted by the taglib doesn't have a composed ID (e.g. portletid:formid:containerid:... etc) but a simple one: "chartDiv". So I end up with many elements with the same ID on page and no matter which portlet I interact with the changes are always made on the first portlet on page.

 

 

 

Thanks!!!!

Edited by Guest

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now