ICEfaces
  1. ICEfaces
  2. ICE-8579

Add de-registration methods for: onBeforeSubmit, onBeforeUpdate, onAfterUpdate, onSessionExpiry, onNetworkError, onServerError

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.3
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      ICEfaces3
    • Assignee Priority:
      P3
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description


      When ace:submitMonitor and ice:outputConnectionStatus register for the connection listeners, there's no means for them to de-register from the listeners, when the components clean themselves up when they're removed from the page. This causes a memory leak, and requires the listener methods to flag themselves as defunct, so they'll just return when called, instead of simply being de-registered.

        Activity

        Hide
        Ken Fyten added a comment - - edited

        This is required to provide optimal memory management for components, particularly in cases where a single page interface is used over a long duration without navigating between pages.

        Show
        Ken Fyten added a comment - - edited This is required to provide optimal memory management for components, particularly in cases where a single page interface is used over a long duration without navigating between pages.
        Hide
        Migration added a comment -

        This is required to provide optimal memory management for components, particularly in cases where a single page interface is used over a long duration without navigating between pages.

        Show
        Migration added a comment - This is required to provide optimal memory management for components, particularly in cases where a single page interface is used over a long duration without navigating between pages.
        Hide
        Mark Collette added a comment -

        Another possible solution is to have variants of these methods where the callback is invoked just once, and automatically de-registered. Then the callback could simply re-add itself in itself, if it wanted to continue getting called.

        Show
        Mark Collette added a comment - Another possible solution is to have variants of these methods where the callback is invoked just once, and automatically de-registered. Then the callback could simply re-add itself in itself, if it wanted to continue getting called.
        Hide
        Mircea Toma added a comment - - edited

        Modified callback registration functions to return un-registering callback function. When this function is invoked the corresponding callback is removed from the list of registered callbacks.

        For example:

        //register callback
        var removeNetworkErrorNotifier = ice.onNetworkError(function() {
          console.error('we have a network error');
        });
        .....
        .....
        //de-registered callback
        removeNetworkErrorNotifier();
        
        Show
        Mircea Toma added a comment - - edited Modified callback registration functions to return un-registering callback function. When this function is invoked the corresponding callback is removed from the list of registered callbacks. For example: //register callback var removeNetworkErrorNotifier = ice.onNetworkError( function () { console.error('we have a network error'); }); ..... ..... //de-registered callback removeNetworkErrorNotifier();

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: