hello,

a simple question: I'd like that a certain javascript function is invoked,
after a Wicket Ajax call completes. I'm using Wicket 6.5.

I tried this:

// behaviour works fine except for the onComplete js that I'd like to
execute
public class MyAjaxBehavior extends AbstractDefaultAjaxBehavior {

    // this doesn't do anything 
    @Override
    protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
        super.updateAjaxAttributes(attributes);

        IAjaxCallListener listener = new AjaxCallListener() {
            @Override
            public CharSequence getCompleteHandler(Component component) {
                return "alert('onComplete');";
            }
        };
        attributes.getAjaxCallListeners().add(listener);
    }

    @Override
    protected void respond(AjaxRequestTarget target){ ... }
}



Another thing I tried, but with the same result (no js executed on
complete), is client-side:

Wicket.Ajax.get({"u":myListenerUrl + params, "coh": myfunction });

(where myfunction is an existing js function).


Do you see what I'm doing wrong ?

Kind regards
Heikki Doeleman



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AbstractDefaultAjaxBehavior-complete-handler-tp4659230.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to