Thank You. This is perfect solution:
add(
new Link("linkWithConfirm") {
@Override
public void onClick() {
setResponsePage(Abc.class);
}
@Override
protected void onComponentTag(ComponentTag tag) {
// parent makes attributes
super.onComponentTag(tag);
// modify onclick attribute
String parentOnclick = tag.getAttribute("onclick");
String newOnclick = "if (!confirm('Sure ?')) return false; " +
parentOnclick;
tag.put("onclick", newOnclick);
}
}
.setPopupSettings(new PopupSettings())
);
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/How-can-I-modify-onclick-attribute-of-Link-wicket7-tp4671900p4671902.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]