kurtomerfaruk / wicked-charts

Automatically exported from code.google.com/p/wicked-charts
0 stars 0 forks source link

WickedCharts-JSF-1.4.2 not working in IE (8) #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create JSF2.1 Project with 'wicked-charts-highcharts-1.4.2.jar' and 
'wicked-charts-jsf21-1.4.2.jar'
2. Create chartbean (from http://wicked-charts.appspot.com/start/?7) and xhtml 
file (faces) descriped here 
(https://code.google.com/p/wicked-charts/wiki/GettingStarted)
3. Run Application and open site in Internet Exlporer 8. 

What is the expected output? What do you see instead?
The chart is not shown, because the generated output contains invalid 
javascript for IE:
<script type="text/javascript"> 
/*<![CDATA[*/
//the following line is not supported in IE
document.addEventListener("DOMContentLoaded", function onDom(event) {
var chart1Options = {
  "chart" : {
    "renderTo" : "chart1",
...

What version of the product are you using? On what operating system?
'wicked-charts-jsf21-1.4.2.jar'
'wicked-charts-highcharts-1.4.2.jar'
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"</script>

Please provide any additional information below.
The Wicked Showcase (with HTML and Wicked - 
http://wicked-charts.appspot.com/start/?7) works fine in IE 8 (already fixed in 
Issue 1).
But my Implementation (see below) generates exactly the issue (1) again:

Bean:
@ManagedBean(name = "myBean")
@SessionScoped
public class Chart {
    Options options = new Options();

    public Chart() {
        initOptions();
    }

    private void initOptions() {
        options.setChartOptions(new ChartOptions().setType(SeriesType.LINE));

        options.setTitle(new Title("My very own chart."));

        options.setxAxis(new Axis().setCategories(Arrays.asList(new String[] {
                "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
                "Oct", "Nov", "Dec" })));

        options.setyAxis(new Axis().setTitle(new Title("Temperature (C)")));

        options.setLegend(new Legend().setLayout(LegendLayout.VERTICAL)
                .setAlign(HorizontalAlignment.RIGHT)
                .setVerticalAlign(VerticalAlignment.TOP).setX(-10).setY(100)
                .setBorderWidth(0));

        options.addSeries(new SimpleSeries().setName("Tokyo").setData(
                Arrays.asList(new Number[] { 7.0, 6.9, 9.5, 14.5, 18.2, 21.5,
                        25.2, 26.5, 23.3, 18.3, 13.9, 9.6 })));

        options.addSeries(new SimpleSeries().setName("New York").setData(
                Arrays.asList(new Number[] { -0.2, 0.8, 5.7, 11.3, 17.0, 22.0,
                        24.8, 24.1, 20.1, 14.1, 8.6, 2.5 })));
    }

    public Options getOptions() {
        return options;
    }

    public void setOptions(Options options) {
        this.options = options;
    }

}

My faces file:
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
    xmlns:wc="http://googlecode.com/wickedcharts"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core">
<f:view>
    <h:head>
        <script
            src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"
            type="text/javascript"></script>
    </h:head>
    <h:body>
        <script src="http://code.highcharts.com/highcharts.js"
            type="text/javascript"></script>
        <wc:chart id="chart1" options="#{myBean.options}" />
    </h:body>
</f:view>
</html>

Original issue reported on code.google.com by veot...@googlemail.com on 5 Feb 2013 at 7:55

GoogleCodeExporter commented 9 years ago
The UIChart.java class 
(https://code.google.com/p/wicked-charts/source/browse/trunk/wicked-charts-jsf21
/src/main/java/com/googlecode/wickedcharts/jsf21/UIChart.java) contains the 
constant PRE_JS which causes this issue.

Maybe a jQuery.ready() would fix it.

Original comment by veot...@googlemail.com on 5 Feb 2013 at 1:12

GoogleCodeExporter commented 9 years ago

Original comment by Matthias.Balke on 6 Feb 2013 at 7:03

GoogleCodeExporter commented 9 years ago

Original comment by Matthias.Balke on 6 Feb 2013 at 7:16

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r235.

Now the fix has to be verified in IE 8

Original comment by Matthias.Balke on 6 Feb 2013 at 7:31

GoogleCodeExporter commented 9 years ago
Would please someone with IE 8 verify the fix?

http://www.wicked-charts.org/wicked-charts-showcase-jsf21/index.xhtml

Original comment by Matthias.Balke on 6 Feb 2013 at 7:35

GoogleCodeExporter commented 9 years ago
Is not working correct (see screenshot)
Javascript error message:
Details zum Fehler auf der Webseite

Meldung: Das Objekt unterstützt diese Eigenschaft oder Methode nicht.
Zeile: 2
Zeichen: 86109
Code: 0
URI: 
http://www.wicked-charts.org/wicked-charts-showcase-jsf21/js/jquery-1.8.1.min.js

It seems that the jQuery version isnt supported by IE8.
From javascript console this ",g=cQ.exec(b)" method in jquery throws the 
exception...

Original comment by veot...@googlemail.com on 7 Feb 2013 at 6:35

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for testing veote12!
Does anybody know which jQuery version is working best with IE 7, IE8 and IE9?

This post on StackOverflow gives some hints on jQuery IE8 bugs:
http://stackoverflow.com/questions/879137/problem-with-jquery-in-internet-explor
er-8

I'll try some of them.

Original comment by Matthias.Balke on 7 Feb 2013 at 8:24

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r236.

using latest jQuery version now (1.9.0)
added type="text/javascript" to script tags

Original comment by Matthias.Balke on 7 Feb 2013 at 8:36

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I tested again. Same issue. But I think is more an IE + jQuery compability 
issue than a problem of wickedcharts.
My IE version is: 8.0.7601.17514CO

Original comment by veot...@googlemail.com on 8 Feb 2013 at 6:10

GoogleCodeExporter commented 9 years ago
Hi ,
 Iam also facing the same issue

Original comment by sathiyan...@gmail.com on 5 Sep 2013 at 7:32

GoogleCodeExporter commented 9 years ago
moved issue to github at https://github.com/thombergs/wicked-charts/issues/7

Original comment by tom.homb...@gmail.com on 21 Apr 2014 at 11:34

GoogleCodeExporter commented 9 years ago

Original comment by tom.homb...@gmail.com on 21 Apr 2014 at 11:38