Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » how to evaluate the data to open flash chart in my custom widget?
how to evaluate the data to open flash chart in my custom widget? [message #766092] Thu, 15 December 2011 08:18
David Song is currently offline David SongFriend
Messages: 217
Registered: April 2011
Senior Member
hi all,

I am going to write a custom widget width the Open Flash Chart to display my chart graphic in my rap app. and as we know, ofc search the vars ofc and data-file in the web page, also the global scope javascript fucntion open_flash_chart_data() to fetch the chart data. I tried the vars ofc and data-file but them did not work, and I don't know how to evaluate the json chart data from the database to the function. I maped the swf and js files to the org.eclipse.rap.ui.resources point in the extentions tab in Plugin.xml. Some codes for Chart.js file are just like below,

qx.Class.define( "com.learn.rap.flashchart.Chart", {
	extend : qx.ui.layout.CanvasLayout,
	
	construct: function( id ) {
        this.base( arguments );
        this.setHtmlAttribute( "id", id );
        this._id = id;
    },
    
    properties : {
        chartData : {
            init : "",
            apply : "initChart"
        }
    },
    
    members : {
        _doActivate : function() {
            var shell = null;
            var parent = this.getParent();
            while( shell == null && parent != null ) {
                if( parent.classname == "org.eclipse.swt.widgets.Shell" ) {
                    shell = parent;
                }
                parent = parent.getParent();
            }
            if( shell != null ) {
                shell.setActiveChild( this );
            }
        },
        
       
        
        initChart : function() {
        	if (this.getChartData()) {
        		var t = "<object width=\"100%\" height=\"100%\">"+
	        	"<param name=\"movie\" value=\"/com/learn/rap/flashchart/internal/chartkit/open-flash-chart.swf?&data-file="+
	        	JSON.stringify(this.getChartData())+
	        	"></param><embed width=\"100%\" height=\"100%\" type=\"application/x-shockwave-flash\" src=\"/com/learn/rap/flashchart/internal/chartkit/open-flash-chart.swf?data-file="+
	        	JSON.stringify(this.getChartData())+
	        	"></embed></object>";
        		document.getElementById(this._id).innerHTML = t;        		
        	}
        }
    }
});


by the way JSON can not run in IE.

Thanks a lot
David

Previous Topic:KeyEvent management differs depending browser
Next Topic:how to evaluate the data to open flash chart in my custom widget?
Goto Forum:
  


Current Time: Sat Jun 10 05:49:09 GMT 2023

Powered by FUDForum. Page generated in 0.02022 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top