I use custom event binding quite a bit within jQuery... for instance:

$(document).bind('fooUpdated', function() {
  // here I make a textfield within foo into an autocomplete textfield
});

Then, when I call to AJAX that replaces "foo", I just do:

$(document).trigger('fooUpdated');

This works great.  Just do all your UI component creation within custom
event handlers.  Then, to handle the creation of them on load, use:

$(document).ready(function() {
     $(document).trigger('fooUpdated');
});


The problem comes when using plugins that [foolishly] use $(document).ready
to do any styling, etc.  If you encounter them, you may be able to try
$(document).trigger('ready');  I have never tried this - there may be
unintended consequences.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Oct 27, 2009 at 11:38 PM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> ... and expect trouble with ajaxifying jquery plugins that skin html
> components. They will not work properly if you replace your components
> via ajax - or at least you might have to work hard on it.
>
> **
> Marin
>
> 2009/10/27 Jeremy Thomerson <jer...@wickettraining.com>:
> > I'd suggest only using jQuery for the UI effects and let Wicket do the
> AJAX.
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> >
> > On Tue, Oct 27, 2009 at 4:06 PM, Jeffrey Schneller <
> > jeffrey.schnel...@envisa.com> wrote:
> >
> >> I am trying to determine how to use Wicket and JQuery.  I would prefer
> >> not using wiQuery or similar.  I would like to just include the jQuery
> >> libraries in my html and then use jQuery as javascript and not wrap
> >> everything in java on the server side to generate the client code.
> >>
> >>
> >>
> >> How would one go about doing this?  I assume the basic jQuery
> >> functionality is straight forward.  However how would you implement
> >> jQuery code that uses Ajax to communicate back to the server using
> >> Wicket on the server?  Or would the recommendation be to let Wicket
> >> handle the Ajax communication and only use jQuery for the UI components
> >> such as "Lightbox", "Greybox", apple like sliders, etc.
> >>
> >>
> >>
> >> Any ideas?
> >>
> >>
> >>
> >> Thanks.
> >>
> >>
> >>
> >>
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to