Sure, it's just Java:

add(new Link("myLink") {
    public void onClick() {
        if (buttonClicked) {
            // do something else if button (was) clicked
        } else {
            // do something here...
        }
    }
});

add(new Button("myButton") {
    public void onSubmit() {
        buttonClicked = true;
    }
});

Hope this helps

Sven


On 06/02/2011 07:21 PM, meduolis wrote:
Is there any way to update onClick method for the same link?

Let say I have link


add(new Link("myLink") {
     public void onClick() {
         // do something here...
     }
);


And later, when I click other control I want to update myLink onClick logic

public void onClick() {
     // do something else if button clicked
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-onClick-method-update-on-runtime-tp3568895p3568895.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to