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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0021290
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] B. User interfaceminorsometimes2012-08-02 13:362012-08-22 09:51
ReportercaristuView Statuspublic 
Assigned ToAugustoMauch 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchpiFixed in SCM revision433a0c50b71c
ProjectionnoneETAnoneTarget Version3.0MP16
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned Tocaristu
Web browserMozilla Firefox
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0021290: Unresponsive Script when creating the first record

DescriptionWhen using Mozilla Firefox, if you create the first children record in a window, using the "Create One" green link the application is stopped and after a few seconds the "Unresponsive Script" Warning of Firefox appears.
Steps To ReproduceThe steps to reproduce are applicable in almost every window. We take the Sales Invoice, for example:

1) Using Firefox, go to [Sales Invoice] window
2) Create a new record. Save it.
3) In the [Lines] tab, click in the "Create One" link. The application is stopped and the warning appears.
4) If you use the toolbar button in order to create the first children record, the problem does not happen.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0051226)
dbaz (developer)
2012-08-09 21:43

I can not reproduce the issue. Even more, the "Create one" action is defined in:

/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js

Line 900 inside "dataArrived" function:
      this.noDataEmptyMessage = '<span class="' + this.emptyMessageStyle + '">' + OB.I18N.getLabel('OBUIAPP_GridNoRecords') + '</span>' + '<span onclick="window[\'' + this.ID + '\'].view.newRow();" class="' + this.emptyMessageLinkStyle + '">' + OB.I18N.getLabel('OBUIAPP_GridCreateOne') + '</span>';


And as you can see this is a "view.newRow()" call.

Looking to the "New Row" toolbar button (that the issue description says that always work) is defined in:

/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js

Line 115 inside "NEW_ROW_BUTTON_PROPERTIES:" function:
        view.newRow();

So at the end the same function is called.
(0051249)
dbaz (developer)
2012-08-10 16:31

What I have noticed is that sometimes it adds two new rows, it is like the onclick happens twice. To fix it change line 900 (ob-view-grid.js) by


      this.noDataEmptyMessage = '<span class="' + this.emptyMessageStyle + '">' + OB.I18N.getLabel('OBUIAPP_GridNoRecords') + '</span>' + '<span onclick="this.onclick = new Function(); window[\'' + this.ID + '\'].view.newRow(); return false;" class="' + this.emptyMessageLinkStyle + '">' + OB.I18N.getLabel('OBUIAPP_GridCreateOne') + '</span>';

Note that I overwrite the onclick function in the same onclick, to ensure it is executed just one time.


Also in an environment where the issue can be reproduced, a test to try if the issue is fixed could be change line 900 by:

      this.noDataEmptyMessage = '<span class="' + this.emptyMessageStyle + '">' + OB.I18N.getLabel('OBUIAPP_GridNoRecords') + '</span>' + '<span onclick="this.onclick = new Function(); setTimeout(function() { window[\'' + this.ID + '\'].view.newRow(); }, 50); return false;" class="' + this.emptyMessageLinkStyle + '">' + OB.I18N.getLabel('OBUIAPP_GridCreateOne') + '</span>';

(it adds a timeout)
(0051274)
AugustoMauch (manager)
2012-08-14 09:29

The timeout fix that dbaz suggested works. I tried to fix it by forcing the focus of the tab before creating the new row, but it did not work:

'<span onclick="this.onclick = new Function();window[\'' + this.ID + '\'].view.parentTabSet.selectTab(window[\'' + this.ID + '\'].view.parentTabSet.getTabNumber(window[\'' + this.ID + '\'].view.tab));window[\'' + this.ID + '\'].view.newRow();"

dbaz fix will be used, along with the patch to prevent multiple clicks on the Create One button
(0051275)
hgbot (developer)
2012-08-14 10:03

Repository: erp/devel/pi
Changeset: 433a0c50b71c27f0b1fc8225f7f17fdf7cb965ae
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Aug 14 09:57:47 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/433a0c50b71c27f0b1fc8225f7f17fdf7cb965ae [^]

Fixes issue 21290: Creating first record no longer unresponsive

If a new record was created in a parent tab, and then the Create One record in the child tab was pushed while the focus was still in the parent tab, then the browser would freeze for a while and the Unresponsive Script warning would be shown (only in Firefox).

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0051293)
AugustoMauch (manager)
2012-08-14 14:33

Issue reopened to enter Closed by field
(0051446)
caristu (developer)
2012-08-22 09:51

Verified

- Issue History
Date Modified Username Field Change
2012-08-02 13:36 caristu New Issue
2012-08-02 13:36 caristu Assigned To => dbaz
2012-08-02 13:36 caristu Web browser => Mozilla Firefox
2012-08-02 13:36 caristu Modules => Core
2012-08-02 13:36 caristu Resolution time => 1350424800
2012-08-02 13:36 caristu Issue Monitored: networkb
2012-08-02 14:03 caristu Web browser Mozilla Firefox => Mozilla Firefox
2012-08-02 14:03 caristu Description Updated View Revisions
2012-08-02 14:03 caristu Steps to Reproduce Updated View Revisions
2012-08-09 21:43 dbaz Note Added: 0051226
2012-08-10 16:18 dbaz Assigned To dbaz => AugustoMauch
2012-08-10 16:31 dbaz Note Added: 0051249
2012-08-14 09:29 AugustoMauch Note Added: 0051274
2012-08-14 10:03 hgbot Checkin
2012-08-14 10:03 hgbot Note Added: 0051275
2012-08-14 10:03 hgbot Status new => resolved
2012-08-14 10:03 hgbot Resolution open => fixed
2012-08-14 10:03 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/433a0c50b71c27f0b1fc8225f7f17fdf7cb965ae [^]
2012-08-14 14:33 AugustoMauch Note Added: 0051293
2012-08-14 14:33 AugustoMauch Status resolved => new
2012-08-14 14:33 AugustoMauch Resolution fixed => open
2012-08-14 14:36 AugustoMauch Closed by => migueldejuana
2012-08-14 14:36 AugustoMauch Web browser Mozilla Firefox => Mozilla Firefox
2012-08-14 14:36 AugustoMauch Status new => scheduled
2012-08-14 14:36 AugustoMauch fix_in_branch => pi
2012-08-14 14:36 AugustoMauch Status scheduled => resolved
2012-08-14 14:36 AugustoMauch Resolution open => fixed
2012-08-21 02:01 eintelau Issue Monitored: eintelau
2012-08-22 09:51 caristu Closed by migueldejuana => caristu
2012-08-22 09:51 caristu Note Added: 0051446
2012-08-22 09:51 caristu Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker