You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

It's common to want the user to confirm his action if it would be hard to reverse, e.g. if he asked to delete something. Here's one way to do this, using Javascript:

Link removeLink = new Link("removeLink") {
			@Override
			public void onClick() {
				// do something you want to confirm beforehand
			}
		};

removeLink.add( new SimpleAttributeModifier("onclick", "return confirm('are you sure?');"));
  • No labels