Get the generic type of a generic class
A simple java line allows to do that :
[java] (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
A simple java line allows to do that :
[java] (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
Davs Rants is playing with the last YUI version (2.3.0) and he proposes sources code and demos on his blog.
Examples are interesting because they can fit to real web developer needs. Lets have a look…
In order to be more complete on javascript framework on my blog, I decided to open a new category on my blog about YUI.
This framework is as interresting as Dojo one because it contains a lot of functionnalities and it also has a WicketStuff project : Wicketstuff-yui.
More news on future post…

Dijit:
* unified look and feel for all widgets
* ambitious a11y and i18n features in every Dijit widget
* a mature CSS-driven theme system with multiple, high-quality themes
* huge improvements in system performance
* data-bound widgets
* Declarations for lightweight widget writing
* a new page parser that allows instances of any class, not just widgets
* no magicCore:
* reduced API surface area (easier to remember and use)
* dojo.query() always available, returns real arrays
* from-scratch high-performance DnD system
* Base (dojo.js) is 25K on the wire (gzipped)
* dojo.data APIs finalized
* new build system
* new test harness for both CLI and browser use
* dojo.behavior now marked stable and based on dojo.query
* excellent animation APIs with Color animations in Base (always available)
* all the features you’ve come to count on from Dojo (RPC, JSON-P, JSON, i18n, formatting utilities, etc.)DojoX:
* high quality implementations of previously experimental features:
* gfx (portable 2D drawing)
* data wires
* offline
* storage
* cometd (Bayeux client)
* etc.
* dojox.gfx now includes Sliverlight support
* many more features and improvements than there’s room for here
Dojo out of the box is not really efficient, there are some optimization to do before putting it in production :
You can also read this very interesting article from Eugene Lazutkin about Dojo Application Optimization.
![]() |
I’ve just tried Spock yesterday and I found the concept quite interesting. Spock is a meta search engine to find… people! Spock searches on other search engine (as Google), on community web site and on all other kind of web site to found out a person by his name or with some keywords. As all web 2.0 new web application, you need an invite to use it! Now, be carefull about your private information, it can be easy to find them with this tool |
The first new WicketStuffDojo release is out. It is named 1.3.0-beta in order to follow wicket version number while it is still possible. WicketStuffDojo-1.3.0-beta depends on wicket-1.3.0-beta2. You can find it on wicketstuff public repo.
You can now use a release
. Let us know if you find some bugs (http://wicketstuff.org/jira/browse/DOJO)
Have good fun with it.
Handling keyboard events is a real nightmare. If you want connect some keyboard events, this page can be usefull : http://unixpapa.com/js/key.html.
Moreover, you need to know Internet Explorer and firefox do no handle event on the same way:
firefox
[javascript] myDomNode.onkeypress = function(event) { alert(event.keyCode)}
ie
[javascript] myDomNode.onkeypress = function() { alert(window.event.keyCode)}
Actually IE propage key event on window.
So to deal with that mess you need to do
[javascript] myDomNode.onkeypress = function(event) {if (!event){event = window.event;} alert(event.keyCode);}
If you want to make cross-browser applications, you need to know that : IE7 as IE6 does not support css2. Actually some css2 attributes are supported but just a very little set.
To avoid any anoyance, just read css2 specification and do not use CSS2 properties (such as inherit).
Imagine you want (with javascript of course) giving an argument to a timeout method(it is the same for event connector)
ie
[javascript] function aFunction(aVariable){ window.setTimeout(myFunction(){alert(aVariable)}, 500); }
This will not work because the function executed on timeOut can not have access to aVariable. So there are to way to deal with that
first : You can use an eval BUT this will throw some exception in our dear IE :
[javascript] function aFunction(aVariable){ window.setTimeout(eval("myFunction(){alert('" + aVariable + "')}", 500); }
Second, the better You can use a function returning a function :
[javascript] function aFunction(aVariable){ window.setTimeout(getOnTimeOut(aVariable), 500); } function getOnTimeOut(aVariable){ return function(){ // no params alert(aVariable); } }