I want to show a jQuery dialog as conformation-popup, when the user clicks on a cancel link. ("Do you really want to cancel?")
jQuery(#{rich:element('cancel')}).click(function(event) {
var dialog = jQuery(#{rich:element('cancelDialog')});
if (dialog.is(':visible')) {
jQuery(#{rich:element('cancelDialog')}).dialog('close');
}
else {
jQuery(#{rich:element('cancelDialog')}).dialog('open');
event.preventDefault();
}
});
<h:commandLink action="cancel" immediate="true" id="cancel" value="cancel" />
The dialog is opening, but the event won't be canceled (--> the cancel event is proceeded). When i use a h:commandButton instead, it works, but the customer wants this as a link.
I use JSF 2.0 (MyFaces), jQuery 1.6.1, Spring Webflow 2.3.0.RELEASE and as JSF Framework Richfaces 4.0.0.FINAL. Does anyone knows a solution with these frameworks? I can't use other frameworks.
Thank you, Patrick