PDA

View Full Version : what is the best way to wrap ux classes into GWT Components



akhopkar
25 Nov 2008, 8:14 AM
Hi guys,

I was pointed through another forum to use:
http://code.google.com/p/uxmedia/

the uxmedia project code to use Flash and fusion charts in GWT. A post stated that these classes are available for use in ext GWT in 'ux' format.

My question is, is there either already a wrapper for these components in ext GWT or if not is there an easy way to wrap these 'ux' classes into GWT components? We basically want to use Flash in one place and FusionCharts in another place in our GWT Application.

What is the best way to do this?

Thanks,

Amarish

gslender
25 Nov 2008, 11:31 PM
For OFC charting check out http://extjs.com/forum/showthread.php?t=48627

akhopkar
26 Nov 2008, 12:56 AM
Hi Grant,

Thanks for your post.

At this time, we have decided to go with FusionCharts not ofcgwt because we are going to make excessive use of the stacked/multiseries charts and these are much more visually appealing in FusionCharts than in ofcgwt.

Also, there's another remote .swf that we want to show on a portion of our app, so we want to be able to wrap that into a GWT component.

We do understand that the user extensions for flash and Chartinf (ux) in extjs (for flash and FusionCharts respectively) are helpful in this purpose but are wondering if there is any 'EASY/QUICK/STANDARD' way to wrap these into GWT ext Widgets that we can use.

Any idea about this specifically?

Thanks,

Amarish

LINEMAN78
26 Nov 2008, 8:50 AM
I am using Fusion Charts right now and I have found there are no good flash embed libraries that do not put unreasonable overhead on your app. I ended up writing my own GWT wrapper for the fussion.js library that comes with fusion charts. Unfortunately I cannot make this available to you, but I can tell you that it is modeled around the GWT2SWF library, which is a GWT wrapper for the swfobject.js library and might work for you. I found it a bit clunky.

http://code.google.com/p/gwt2swf/

amolsarode
28 Jan 2009, 5:58 AM
Hi LINEMAN,

I need to write GWT wrapper for fusion js.

I tried the link provided by you....but was not able to make it.


Can you please guide the way to wrap fusion chart js into GWT ext Widgets ?

Thanks,

Amol

LINEMAN78
28 Jan 2009, 12:14 PM
Unfortunately I cannot post the code because it is proprietary, but I will try to give you enough information to replicate.

FusionChartWidget extends Composite
- you will need a static int to count how many have been created do you can set unique ids on the div you will be passing to the fusionchart js library.
- HTML holder = new HTML("<div id=\"" + swfDivId + "\"></div>");
- initWidget(holder)
- Override onAttach to call chart.render(swfDivId) if the chart has not been rendered.

FusionChart extends JavaScriptObject
- create a static final FusionChartImpl
- create a static methods to wrap FusionChartImpl methods

FusionChartImpl
- create native methods that just wrap the 3 js functions new $wnd.FusionCharts, chart.setDataURL and chart.render

Make sure you are including the FusionCharts.js in your html or gwt.xml

Using these guidelines and the source for the library I linked above you should be able to create a wrapper. If you have specific questions I would be happy to answer them, but if you are still confused, I cannot give any more broad spectrem help and maybe you need to spend some more time learning about JSNI or settle for the shortfalls of the above linked library.