THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
public class JavascriptEventConfirmation extends AttributeModifier { public JavascriptEventConfirmation(String event, String msg) { super(event, true, new Model(msg)); } protected String newValue(final String currentValue, final String replacementValue) { String result = "return confirm('" + replacementValue + "')"; if (currentValue != null) { result = currentValue + "; " + result; } return result; } } |
Then we attach the modifier to the link:
...