Christoph,

I have use yout approach (jQuery + css-class) for some time now as well. 
However, I
have found that if the DOM tree grows rather large, a full scan puts 
significant load
on the browser. That's why I want to be more specific and limit the scanning + 
updating
to the relevant parts of the page.

J.

On 19.02.2012 13:02, Christoph Leiter wrote:
On 18.02.2012 17:46, Jürgen Lind wrote:
thank you for your reply, I did not know that such a method exists (does
it for 1.4
or is this already Wicket 1.5). An secondly: are these handlers fired on
a ajax
update of an existing DOM Element or only when it is added?

This is also available in 1.4. The events are fired when you add
something to the ajax request via target.add(Component)

And where would I put the Javascript that registers the handler? In the
Markup-Page of
the Component? How do I make sure, the handler is added only once?

I use jQuery and register the handler globally in my main.js for every
page within $(document).ready().

This approach works very well if you don't want to create subclasses of
components but rather execute some specific JS if e.g. a css class is
present. I use it to add a hint image to every autocomplete textfield
via jQuery.

If it's more component specific then the renderHead() solution seems better.


Christoph

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



--
Dr. Jürgen Lind
iteratec GmbH                Fon: +49 (0)89 614551-44
Inselkammerstrasse 4         Fax: +49 (0)89 614551-10
82008 Unterhaching           Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to