Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0024197Openbravo ERPA. Platformpublic2013-06-26 13:452013-07-16 14:26
caristu 
dbaz 
highminoralways
closedfixed 
5
 
3.0MP263.0MP26 
AugustoMauch
Core
No
0024197: Form is not refreshed after executing a business event handler for the Note entity
If we develop a business event handler for the Notes entity, the form is not refreshed. After adding/removing the note, it is necessary to click on the refresh button manually to see the updated information.
1) Create a business event handler(http://wiki.openbravo.com/wiki/How_to_implement_a_business_event_handler [^]) for the Note entity (see attached example)
2) After adding a event handler similar to the attached one, create a new note
3) Notice that the data is changed correctly but the form is not showing the changes. It is necessary to click on the refresh button to see the updated information.
No tags attached.
related to feature request 00262353.0PR14Q3 closed guillermogil Refresh the grid after deleting a record in the user interface 
related to feature request 0028670 closed platform Ability to refresh the grid after creating or updating a record in a tab 
related to feature request 00332633.0PR16Q4 closed caristu Implement Client Side Event Handler Extensions 
? NoteEventHandler.java (1,291) 2013-06-26 16:12
https://issues.openbravo.com/file_download.php?file_id=6226&type=bug
Issue History
2013-06-26 13:45caristuNew Issue
2013-06-26 13:45caristuAssigned To => AugustoMauch
2013-06-26 13:45caristuModules => Core
2013-06-26 13:45caristuResolution time => 1378072800
2013-06-26 13:45caristuTriggers an Emergency Pack => No
2013-06-26 13:46caristuIssue Monitored: networkb
2013-06-26 16:09caristuSummaryChexbox fields are not updated from business event handler => Grid is not refreshed after executing a business event handler for the Note entity
2013-06-26 16:09caristuDescription Updatedbug_revision_view_page.php?rev_id=4830#r4830
2013-06-26 16:09caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4832#r4832
2013-06-26 16:11caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4833#r4833
2013-06-26 16:12caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4834#r4834
2013-06-26 16:12caristuFile Added: NoteEventHandler.java
2013-07-02 17:49AugustoMauchAssigned ToAugustoMauch => dbaz
2013-07-03 18:32caristuSummaryGrid is not refreshed after executing a business event handler for the Note entity => Form is not refreshed after executing a business event handler for the Note entity
2013-07-03 18:32caristuDescription Updatedbug_revision_view_page.php?rev_id=4853#r4853
2013-07-03 18:32caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4854#r4854
2013-07-03 23:46dbazNote Added: 0059850
2013-07-03 23:46dbazTypedefect => design defect
2013-07-03 23:46dbazReview Assigned To => AugustoMauch
2013-07-03 23:58dbazNote Added: 0059851
2013-07-04 00:11hgbotCheckin
2013-07-04 00:11hgbotNote Added: 0059852
2013-07-04 00:11hgbotStatusnew => resolved
2013-07-04 00:11hgbotResolutionopen => fixed
2013-07-04 00:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6b684b7d61d6c226822670b4b80db4a250019e1e [^]
2013-07-05 00:06dbazIssue Monitored: AugustoMauch
2013-07-05 13:35AugustoMauchNote Added: 0059894
2013-07-05 13:35AugustoMauchStatusresolved => closed
2013-07-05 13:35AugustoMauchFixed in Version => 3.0MP26
2013-07-16 14:26hudsonbotCheckin
2013-07-16 14:26hudsonbotNote Added: 0060023
2014-04-10 11:17caristuRelationship addedrelated to 0026235
2015-01-19 09:58caristuRelationship addedrelated to 0028670
2016-06-14 19:44caristuRelationship addedrelated to 0033263

Notes
(0059850)
dbaz   
2013-07-03 23:46   
Changed to 'design deffect', since event handler just manage the database information and is not its function update the UI
(0059851)
dbaz   
2013-07-03 23:58   
In the fix a new feature is going to be added that will add the capability to specify a particular entity for which window a full form refresh will be done once you add/remove any note.

The mechanism to specify the entity uses javascript: Entities can be added to the list of 'entities to refresh' by third parties by doing:
  isc.OBNoteLayout.getPrototype().refreshFormWithEntities.push(theEntityName);
Where 'theEntityName' is the string with the name of the entity.
If the string 'all' is provided, it will refresh in all windows.


Test case:
1) As 'Openbravo Admin' go to 'Business Partner' window:
 * Add a new note: nothing special happens, the note is added
 * Delete this created note: nothing special happens, the note is deleted
 * Change any form field value and then (WITHOUT SAVING):
 * Add a new note: nothing special happens, the note is added
 * Delete this created note: nothing special happens, the note is deleted

2) Ensure that the following code is present in the javascript (add a new module containing a file with this code, or use developer tools console to inject it or whatever you want)

isc.OBNoteLayout.getPrototype().refreshFormWithEntities.push('BusinessPartner');

Then, as 'Openbravo Admin' go to 'Business Partner' window:
 * Add a new note: the note is added and then the form is refreshed
 * Delete this created note: the note is deleted and then the form is refreshed
 * Change any form field value and then (WITHOUT SAVING):
 * Add a new note: an error message is shown saying that it is impossible to continue adding the note
 * Save the form changes
 * Add a new note: the note is added and then the form is refreshed
 * Change any form field value and then (WITHOUT SAVING):
 * Delete this created note: an error message is shown saying that it is impossible to continue deleting the note
(0059852)
hgbot   
2013-07-04 00:11   
Repository: erp/devel/pi
Changeset: 6b684b7d61d6c226822670b4b80db4a250019e1e
Author: David Baz Fayos <david.baz <at> openbravo.com>
Date: Thu Jul 04 00:10:53 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6b684b7d61d6c226822670b4b80db4a250019e1e [^]

Fixed issue 24197: Added capabilities to refresh the form
after add or remove a note

---
M modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js
---
(0059894)
AugustoMauch   
2013-07-05 13:35   
Code reviewed and verified in pi@c708a98b9d60
(0060023)
hudsonbot   
2013-07-16 14:26   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9a5d5983399f [^]

Maturity status: Test