Project:
View Revisions: Issue #50242 | [ Back to Issue ] | ||
Summary | 0050242: Setting the value of a field in the Status Bar with an EventObserver need a refresh | ||
Revision | 2022-09-13 17:06 by migueldejuana | ||
Steps To Reproduce | - Create this Event Observer: public class TestOrderStatusEventObserver extends EntityPersistenceEventObserver { private static final Entity[] ENTITIES = { ModelProvider.getInstance().getEntity(Order.ENTITY_NAME) }; private static final Property DOCSTATUS_PROPERTY = ENTITIES[0] .getProperty(Order.PROPERTY_DOCUMENTSTATUS); @Override protected Entity[] getObservedEntities() { return ENTITIES; } public void onSave(@Observes final EntityNewEvent event) { if (!isValidEvent(event)) { return; } event.setCurrentState(DOCSTATUS_PROPERTY, "CO"); } } - Open Sales Order window in the ERP - Create new Sales Order in Form Mode and Save. - ERROR! In the Status Bar, Document Status is "Draft" and it should be "Booked" - If we refresh the Sales Order, the Status Bar is updated and we see Document Status: Booked |
||
Revision | 2022-09-13 17:05 by migueldejuana | ||
Steps To Reproduce | - Create this Event Observer: public class TestOrderStatusEventObserver extends EntityPersistenceEventObserver { private static final Entity[] ENTITIES = { ModelProvider.getInstance().getEntity(Order.ENTITY_NAME) }; private static final Property DOCSTATUS_PROPERTY = ENTITIES[0] .getProperty(Order.PROPERTY_DOCUMENTSTATUS); @Override protected Entity[] getObservedEntities() { return ENTITIES; } public void onSave(@Observes final EntityNewEvent event) { if (!isValidEvent(event)) { return; } event.setCurrentState(DOCSTATUS_PROPERTY, "CO"); } } - Open Sales Order window in the ERP - Create new Sales Order in Form Mode and Save. - ERROR! In the Status Bar, Document Status is "Draft" and it should be "Booked" |
||
Revision | 2022-09-13 17:04 by migueldejuana | ||
Steps To Reproduce | - Create this Event Observer: public class TestOrderStatusEventObserver extends EntityPersistenceEventObserver { private static final Entity[] ENTITIES = { ModelProvider.getInstance().getEntity(Order.ENTITY_NAME) }; private static final Property DOCSTATUS_PROPERTY = ENTITIES[0] .getProperty(Order.PROPERTY_DOCUMENTSTATUS); @Override protected Entity[] getObservedEntities() { return ENTITIES; } public void onSave(@Observes final EntityNewEvent event) { if (!isValidEvent(event)) { return; } event.setCurrentState(DOCSTATUS_PROPERTY, "CO"); } } - Open Sales Order window in the ERP - Create new Sales Order in Form Mode and Save. - ERROR! In the Status Bar, Document Status is "Draft" and it should be "Confirmed" |
Copyright © 2000 - 2009 MantisBT Group |