Serkan Camurcuoglu wrote:

> just noticed I forgot to add the behavior to the link, but still the
> javascript does not show up..
I know your mail was some time ago, but I just had the same problem and found a 
solution. Maybe it helps somebody else
in future... The problem is that the fadeOut() method doesnt "block". It 
executes and immediately afterwards the wicket
ajax-code is called. Which means you never see your wanted effects. Solution: 
use the jQuery callback-parameter.

let newValue return for example:
String.format("$('#%s').fadeOut('normal', function(){ %s });", 
topContainer.getMarkupId(), current);


regards,
Daniel

> Serkan Camurcuoglu wrote:
>> How can I modify the onclick attribute of the links in the
>> AjaxPagingNavigator? I override newPagingNavigationLink in my ajax
>> paging navigator as shown below, but my javascript is not prepended. I
>> want to add JQuery fadeout code before wicketAjaxGet:
>>
>> @Override
>>    protected Link newPagingNavigationLink(String arg0, IPageable arg1,
>> int arg2) {
>>        AjaxPagingNavigationLink l = (AjaxPagingNavigationLink)
>> super.newPagingNavigationLink(arg0, arg1, arg2);
>>        String onClickJavascript =
>> "jQuery('#"+topContainer.getMarkupId()+"').fadeOut('slow');";
>>        AttributeModifier am = new AttributeModifier("onclick", new
>> Model(onClickJavascript)) {
>>            @Override
>>            protected String newValue(String current, String
>> replacement) {
>>                // prepend javascript before ajax call..
>>                return replacement + current;
>>            }
>>        };
>>        return l;
>>    }
>>
>>
>> Serkan Camurcuoglu wrote:
>>> Hi all,
>>> I want to add some decoration to AjaxPagingNavigator. I want the
>>> current page to fade out and the new page to fade in when the user
>>> clicks next. I'm thinking of using JQuery for effects. Can anybody
>>> show me some pointers to achieve this?
>>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to