views:

202

answers:

1

Basically jquery is usable with IceFaces. Then only problem arises when partial updates of the page are used. For example you have a panelgroup where a jquery datepicker element (jquery UI datepicker plugin) is used.

If the panelGroup is visible from the beginning it's no problem. The jquery call to jQuery(".datepicker").datepicker finds the input and jquery can do it's magic.

But if the panelGroup is shown because of a partial update of the page (because the visible propery is changed) jquery is not called again.

Does anybody has a solution to this problem?

Basically the idea would be that jquery is run each time the dom has changed.

+1  A: 

I have found an answer at least for the datepicker, just use the .live (jquery 1.3+) like in this example:

jQuery(function(){
    jQuery('.datepicker').live('click', function() {

        jQuery(this).datepicker({ dateFormat: 'yy-mm-dd', gotoCurrent:true, showOn:'focus' }).focus();
    });
});

Solution was found here: http://www.vancelucas.com/blog/jquery-ui-datepicker-with-ajax-and-livequery/

hubertg
+1 for answering your own question. Cheers.
javashlook