struts-community-plugins / struts2-jquery

Struts2 jQuery Plugin
Apache License 2.0
83 stars 49 forks source link

Version 5.0: tabbedpanel is no longer working due to deprecated jqXHR.success #313

Closed amellie closed 1 year ago

amellie commented 1 year ago

<sj:tabbedpanel> is no longer working with the following JS error:

Uncaught TypeError: e.jqXHR.success is not a function

This is due to the qXHR.success function used in jquery.ui.struts2.js which has been deprecated by jQuery

Is this something that can be fixed soon?

LamseyMcBrien commented 1 year ago

From http://api.jquery.com/jquery.ajax/:

Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are removed as of jQuery 3.0. You can use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

We need to update the call from ui.jqXHR.success() to ui.jqXHR.done() to resolve the reported issue. I've tested this locally by overriding the function with the correct call before triggering the tabbed panel to perform the AJAX action, and it seems to fix the issue.