Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.)