Hi all,

I am wanting to combine an AjaxRequestTarget addComponent call with a javascript call as well so that the component is added to the page by wicket, but displayed using a jQuery effect. The component adds to the page fine, but the jQuery effect doesn't seem to be working, the component just appears. Is it something to do with the order of when its set to be visible/prepend/append javascript?

//change picture panel
changePicture = new ChangeProfilePicture("changePicture", userProfile);
changePicture.setOutputMarkupPlaceholderTag(true);
//changePicture.setOutputMarkupId(true);
changePicture.setVisible(false);
add(changePicture);
                
//change profile image button
AjaxFallbackLink changePictureLink = new AjaxFallbackLink("changePictureLink", new ResourceModel("link.change.profile.picture")) {
        public void onClick(AjaxRequestTarget target) {
                                
                //add the full changePicture component to the page dynamically
                target.addComponent(changePicture);
                changePicture.setVisible(true);
String js = "$('#" + changePicture.getMarkupId() + "').fadeIn('slow')";
                target.appendJavascript(js);

        }
                                                
};
add(changePictureLink);

Any help much appreciated.


cheers,
Steve



Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to