Hi,

you're adding an additional behavior that has nothing to do with the behavior created in AjaxLink#newAjaxEventBehavior().

SomeAjaxBehavior#updateAjaxAttributes() and #respond() are never invoked.

Sven



On 05/27/2013 10:22 PM, stefanofg wrote:
on the other hand, if I create an AbstractDefaultAjaxBehavior, override
updateAjaxAttributes, and attach it to the component, the two handlers are
not invoked:

public class HomePage extends WebPage {
        public HomePage(final PageParameters parameters) {
                super(parameters);

                

                final AjaxLink<String> link = new 
AjaxLink<String>("submit",Model.of("link"))
                {
                        
                        @Override
                        public void onClick(AjaxRequestTarget target)
                        {
                        }
                };
                
                link.add(new SomeAjaxBehavior());
                
                add(link);

     }
}


// SomeSomeAjaxBehavior
public class SomeAjaxBehavior extends AbstractDefaultAjaxBehavior
{

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
        {
                // TODO Auto-generated method stub
                super.updateAjaxAttributes(attributes);
                 IAjaxCallListener listener = new IAjaxCallListener()
              {

                        @Override
                        public CharSequence getBeforeHandler(Component 
component)
                        {
                                return "alert('Before');";
                        }

                        ...

                        @Override
                        public CharSequence getCompleteHandler(Component 
component)
                        {
                                return "alert('Complete');";
                        }
        
              };
        
              attributes.getAjaxCallListeners().add(listener);
        }

        @Override
        protected void respond(AjaxRequestTarget target)
        {
                
        }

}

am I missing something or this is a bug?

Thanks




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IAjaxCallListener-issues-in-AbstractDefaultAjaxBehavior-updateAjaxAttributes-tp4659055.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]



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

Reply via email to