THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
removeLink.add(new JavascriptEventConfirmation("onclick", "are you sure?")); |
If you are using the same confirmation in more than one link, you should subclass Link
to encapsulate the change:
Code Block |
---|
abstract public class ConfirmLink extends Link {
public ConfirmLink(String id, String msg) {
super(id);
add(new JavascriptEventConfirmation("onclick", "are you sure?"));
}
@Override
abstract public void onClick();
}
|
(The subclass could of course use SimpleAttributeModifier
instead.)