Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036445
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajoralways2017-07-07 11:372017-07-13 10:53
ReportermalsasuaView Statuspublic 
Assigned Toranjith_qualiantech_com 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisioncb08b24b56b5
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomigueldejuana
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036445: many listeners are being created for change event in scrollable table when lines are not added in the last position

DescriptionWhen orderlines are created and they are inserted not in the last position (because a customization)[attached], then the method _createComponentForModel of ScrollableComponent component is creating listeners for events change and updateview many times for lines which already have it.
Steps To Reproducesee attachment
Proposed SolutionOption 1 (preferred)

Test it carefully!! Create a static function. Maybe backbone will detect that your "on" is against a function which is already being used as a listener, so it will not create the listener

    this.func_checkAll = function (col) {
      //if the same collection is used by different components and one of them has been destroyed, the event is ignored
      if (this.destroyed) {
        if (this.collection) {
          this.collection.off('checkAll', this.func_checkAll);
        }
        return true;
      }
      this.collection.each(function (model) {
        model.trigger('check');
      });
    };
    this.collection.on('checkAll', this.func_checkAll, this);

Option 2

When creating listerners, first check if a model is already connected to a listener function. If it is, remove the listener (off) and then create again the listener (on).

example:
    if (!this.func_focus) {
      this.func_focus = function () {
        //stuff
      };
    }
    this.task.off('focusCalculated', this.func_focus);
    this.task.on('focusCalculated', this.func_focus);
    //end workaround
TagsNo tags attached.
Attached Filestxt file icon hookPerformanceProblem.txt [^] (401 bytes) 2017-07-07 11:37 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0098055)
hgbot (developer)
2017-07-13 08:13

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: cb08b24b56b58ef9c9998840d4e302041f31b42a
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Jul 13 11:42:37 2017 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/cb08b24b56b58ef9c9998840d4e302041f31b42a [^]

Fixed issue 36445 : Validate duplicate listeners in OB Scrollable Table

* In OBScrollable table, duplicate listeners should be avoided when component is created multiple times for same model

---
M web/org.openbravo.mobile.core/source/component/ob-scrollabletable.js
---
(0098061)
migueldejuana (developer)
2017-07-13 10:53

Tested and reviewed

- Issue History
Date Modified Username Field Change
2017-07-07 11:37 malsasua New Issue
2017-07-07 11:37 malsasua Assigned To => Retail
2017-07-07 11:37 malsasua File Added: hookPerformanceProblem.txt
2017-07-07 11:37 malsasua Resolution time => 1501192800
2017-07-07 11:37 malsasua Triggers an Emergency Pack => No
2017-07-07 11:42 Practics Issue Monitored: Practics
2017-07-10 15:49 jmonfort Issue Monitored: jmonfort
2017-07-12 14:17 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2017-07-12 14:17 ranjith_qualiantech_com Status new => scheduled
2017-07-13 08:13 hgbot Checkin
2017-07-13 08:13 hgbot Note Added: 0098055
2017-07-13 08:13 hgbot Status scheduled => resolved
2017-07-13 08:13 hgbot Resolution open => fixed
2017-07-13 08:13 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/cb08b24b56b58ef9c9998840d4e302041f31b42a [^]
2017-07-13 10:53 migueldejuana Review Assigned To => migueldejuana
2017-07-13 10:53 migueldejuana Note Added: 0098061
2017-07-13 10:53 migueldejuana Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker