AjaxRequestTarget.get returns null within AjaxLink#onClick
----------------------------------------------------------

                 Key: WICKET-3001
                 URL: https://issues.apache.org/jira/browse/WICKET-3001
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5-M1
            Reporter: Daniel Soneira


Code:
--------------------------
...
new AjaxLink<Void>("link") {
    @Override
    public void onClick(AjaxRequestTarget target) {
        feedback("link clicked");
    }
}

public void feedback(String message) {
     info(message);
     AjaxRequestTarget target = AjaxRequestTarget.get();
     if (target != null) {
         target.addComponent(get("feedback"));
     }
}
...
-------------------------- 

In previous versions of Wicket this code worked.
Now target is null and therefore the feedback panel is not re-rendered.
Debugging AjaxRequestTarget.get shows that the active request handler is a 
ListenerInterfaceRequestHandler with an AjaxRequestTarget as next "scheduled" 
handler. 


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to