Comment Added :
WICKET :
Re: Getting user confirmation
Getting user confirmation commented on by Igor Vaynberg (Jan 09, 2007). Comment:the above use of SimpleAttributeModifier is not appropriate because it overwrites the value, a much better approach would be to insert the confirmation script as the first part of the onclick event ala class _javascript_EventConfirmation extends AbstractBehavior { private final String msg; private final String event; public _javascript_EventConfirmation(Striong event, String msg) { this.msg=msg; this.event=event; } protected void onComponentTag(ComponentTag tag) { String script=tag.getAttributes().get(event); script="if (!confirm('"+msg+"')) return false; "+script; tag.put(event, onclick); }}
|
Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request
Unsubscribe or edit your notifications preferences
Unsubscribe or edit your notifications preferences