| function OnClientTabSelecting(sender, eventArgs) { |
| var tab = eventArgs.get_tab(); |
| var navigateUrl = tab.get_navigateUrl(); |
| if (navigateUrl && navigateUrl != "#" && dataChangeField.value == "true") { |
| var proceed = tabConfirm(Click OK to proceed or Cancel to stay on current page.',eventArgs, 330, 100, '', "Change"); |
| if (!proceed) { |
| eventArgs.set_cancel(true); |
| } |
| else { |
| eventArgs.set_cancel(false); |
| dataChangeField.value = "false"; |
| } |
| } |
| window.tabConfirm = function(text, ev, oWidth, oHeight, callerObj, oTitle) { |
| var callerObj = ev._tab._linkElement; |
| if (callerObj) { |
| //Show the confirm, then when it is closing, if returned value was true, automatically call the caller's click method again. |
| var callBackFn = function(arg) { |
| if (arg) { |
| callerObj["onclick"] = ""; |
| if (callerObj.click) callerObj.click(); //Works fine every time in IE, but does not work for links in Moz |
| else if (callerObj.tagName == "A") //We assume it is a link button! |
| { |
| try { |
| eval(callerObj.href) |
| } |
| catch (e) { } |
| } |
| } |
| } |
| radconfirm(text, callBackFn, oWidth, oHeight, callerObj, oTitle); |
| } |
| return false; |
| } |
The requirement is to show a rad confirm window on tab change event. When user clicks OK he/she will be navigated to the clicked tab, on cancel user will remain on current tab itself. The issue is here is radConfirm() is not returning true properly - in OnClientTabSelecting event I am checking whether radConfirm result is true or false and calling set_cancel() method. I am unable to capture the OK button click and set the value here. Would appreciate any inputs on this - this is urgent.
Thanks,
Aneesh