Versions Compared

Key

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

...

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:

...