Write - good point regarding wrap. It's actually a restriction that's always been in effect, they just put in an assertion recently, from my understanding.
On Thu, Apr 16, 2009 at 6:59 AM, Thomas Broyer <[email protected]> wrote: > > > > On 16 avr, 11:53, Vitali Lovich <[email protected]> wrote: > > Is there a particular reason you recommend this approach as opposed to > using > > the HTML widget? For something as simple as this, it seems like overkill > to > > build-up a whole widget wrapping this when it doesn't seem to offer > anything > > over using HTML. > > Well, the new wrap() constraints from GWT 1.6 are a reason (you cannot > wrap an element that has an ancestor element which "looks like" a > widget element). > Building a specialized widget has also the advantage of the API you're > exposing (be it to your own use only), otherwise why not go the low- > level route wholly and use DOM.setEventListener and DOM.sinkEvents > (and don't forget to call DOM.setEventListener(elt, null) on window > close or you'll leak memory)? > ...and creating a new widget is probably much easier than you'd think > at first sight (even more with GWT 1.6 and its new event handlers) > > It's a matter of a) taste b) whether you're using widgets already (and > might face the wrap() restriction) and c) what kind of code you're > (dayre is) porting and how you want (he wants) it ported (rewrite > using GWT widgets? or port the code without fully rewriting it). > > My understanding is that dayre wants to rewrite his jQuery-based app > to GWT widgets, otherwise he would have used GQuery ;-) > (or more seriously, he wouldn't have said "The reason i'm not using > existing GWT widgets, which my example > doesn't show, is because i'm trying to attach an onclick() event to > ordered list items (<li>text</li>). There doesn't seem to be a > widget which easily allows for this.") > > http://code.google.com/p/gwtquery/ > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
