GWT IndexedDB available or any update on this? - gwt

is there any update on GWT IndexedDB?
Here are two projects of GWT IndexedDB but i dont know if this is usefull because these two projects seem to be dead?!
http://code.google.com/p/indexeddb-gwt/
http://code.google.com/p/gwt-indexeddb/
IS it possible to use GWT IndexedDB by JSNI? Has anybody experience with it?
Would like to learn and to use IndexedDB but dont know because iam using only GWT and not JavaScript.
Please help!

You can use any pure javascript/browser functaonlity from GWT using JSNI.
If youu look at the above linked Indexdb gwt libraries they do just that. They define JSO Overlay wrappers for the corresponding javascript objects. (see here as an example).
Alternatively you could also look into the Elemental library. I am not 100% sure but it might contain wrappers for IndexDB.
So you have 4 choices:
Manually call the indexdb javascript functons using JSNI.
Write your own wrapper using JSO and JSNI
Use on of the indexdb GWT wrappers
Use Elemental library.

I used java Maps (TreeMap) package to emulate indexedDB searching functions and GWT built-in html5 storage wrapper to store data offline in browser.

Related

I am confused about JSNI.How and when use of JSNI in Google web toolkit

I am new Google web toolkit.I am confused about JSNI.Why and when use of JSNI in Google web toolkit.Advantage and limitation of JSNI.Thanks in advance.
I use native Javascript code when there is no other way of coding the feature other than in Javascript. For example, there is no wrapper for XmlHttpRequest object in GWT. I could use either third-party solution if it exists, or write my own classes based on javascript-based sample code found around on the web. So, I have this native method that I can call from my pure Java code and that contains only Javascript code. JSNI allows me to share the data between these two worlds.
And after all, after permutations are compiled, both Java and JS native methods are build into Javascript.
If you want to use various Javascript libraries, then JSNI will let you to call methods as designed wrapped into your Java methods. Again, for example, you can include Modernizr.js script into your html page and then have something like this in your class:
private native boolean isCSSAnimationSupported() /*-{
return Modernizr.cssanimations;
}-*/;
I do not use native methods when there is no actual need to inject inline Javascript.
Beside the points alexp already mentioned, there is another situation, where JSNI is a very useful.
Imaging, you have several GWT applications and in case you left one and start another, you want to send some informations to the starting GWT application.
You have several possibilities to do that:
you can use URL parameters
you can use a cookie
or use an JSP and JSNI.
There fore, you use a JSP instead of a HTML as your host page. Inside this JSP you can use a JSP tag of a hidden field to carry your parameter and with JSNI you can read the parameter out of your host page.

How to use History.js with GWT?

I want to use History.js from Google Web Toolkit.
I know GWT has History functionality of it's own, but I don't like it because it uses the hashes in the URI, I want to use the new HTML5 History API as much as possible.
The only current way that I can think of to run History.js and GWT together is to write the History.js part in plain Javascript (or jQuery) and then manually call a GWT method.
It would be nice if it was possible to use the whole History.js functionality from within GWT's Java files.
No pain at all with that .
You just simple add your History js file on your document and you can use it .
Here i answered how you can use an external js in GWT .
Using externel js in GWT
After you call the native method you can continue with gwt method

GWT - Graphical representation of a tree

I want to represent a Tree in my GWt Project in a another way as the standard graphical
representation.
Drag & Drop should be able.
Like this one:
http://s1.directupload.net/file/d/2603/yzo588bb_jpg.htm
Do you know a good GWT Extension to realize this?
I have already looked at the Google Web Toolkit Gallery.
Do you think something like this would solve the problem?
http://gwtgallery.appspot.com/about_app?app_id=86
I'm using Raphaël Gwt for such graphic stuff.
I've tried Vectomatic once, but it is no fun to write, because it seems like the author had no Idea what a namespace is (Several classes starting with OMSVG) and it doesn't "feel" like writing a java programm.
On the other side, with Raphël-GWT is a binding to a javascript-library, thus you have (llittle) Preformance tradeoff for loading an external Cross-browser javascript library.

Is it possible to mix extjs and GWT components?

I am working with GWT2.3 version.I also found ExtJs4 framework very good and want to club the some of component of ExtJs4 in my application(GWT2.3).So I just want to know it is possible to club components of ExtJs4 with GWT application
Thanks in Adcance
Yes it is. Just add .js source to your public folder in /src. Then you can write custom JavaScript as native methods via JSNI. See more in the docs.
Why not use the GWT compatible project? http://www.sencha.com/products/extgwt/
It has the same widget library (afaik) and integrates quite nicely w/ GWT

GWT/java and javascript

can i design my web pages in html and css instead of java methods and use gwt only in parts of page that i need ajax? and which one is better gwt, extgwt, vaadin(it run apps in server-side.can i also use it in client-side?), etc...? do i also need to know javascript for using gwt?
thanks
can i design my web pages in html and
css instead of java methods and use
gwt only in parts of page that i need
ajax?
Yes, you can. You can create a div on your HTML page and insert your GWT widget there.
which one is better gwt, extgwt,
vaadin(it run apps in server-side.can
i also use it in client-side?)
I don't know about vaadin but Ext-GWT is a set of ready made components to use with GWT which make your life easier especially if you want to build an web app that looks and feels like a desktop application.
do i also need to know javascript for
using gwt?
No, it can be useful sometimes but is not necessary.