Hi Stefan, :-) fortunately, it's not as extreme as it sounds - the images don't have to be exchanged very often, but when they do, it must be instantaneous. No problem for Safari/Chrome or Firefox... but it was just a bit too slow on IE8.
Viele Grüße Chris On May 28, 5:55 pm, Stefan Bachert <[email protected]> wrote: > Hi Chris, > > this looks as you are going to program mine sweeper. > May be you should consider to use HTML5 canvas > > Stefan Bacherthttp://gwtworld.de > > On 27 Mai, 21:33, Chris Lercher <[email protected]> wrote: > > > > > Hi, > > > I need to create lots (hundreds) of image tags, and attach them > > dynamically to several plain <div class="xy"></div> elements: > > > <div class="xy"> > > <img src="images/a.gif" style="top: 1em;"/> > > <img src="images/a.gif" style="top: 2em;"/> > > <img src="images/b.gif" style="top: 3em;"/> > > ... > > </div> > > ... > > > The <img> tags can have only two different src urls. But each needs > > individual style attributes (for absolute positioning). > > > Question: > > What would be the fastest (and preferably clean) way to do that? > > > A) GwtQuery (aka GQuery)? > > B) UiBinder? > > C) Other? > > > ---- > > A) The GwtQuery approach: > > > As a first pretty clueless attempt, I'm currently using GwtQuery code > > similar to this: > > > @UiField > > HTML div1; > > > void attachImages(...) { > > for (...) { > > $(div1.getElement()).append( > > "<img src='images/" + (flag ? "a" : "b") + ".gif' style='top:" > > + i + "em'/>"); > > } > > > } > > > @UiHandler("div1") > > void onDivClicked(final ClickEvent event) { > > ... > > > } > > > This works, but a) it's obviously ugly, and b) I don't know, if > > there's a faster/better way. > > > ---- > > B) The UiBinder approach: > > > I chose the HTML class, to get a clean div, and still be able to use > > @UiHandler. But it doesn't seem to be possible to attach (UiBinder) > > Composites to it. What else should I choose? Unfortunately, HTMLPanel > > isn't a subclass of HasClickHandlers, so it doesn't work with > > @UiHandler. > > > ---- > > C) Other approaches: > > > ? > > > Thanks > > Chris -- 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.
