MessageManager doesn't display message in header on Form open [message #1795229] |
Tue, 18 September 2018 19:08 |
Glenn Burkhardt Messages: 12 Registered: April 2017 |
Junior Member |
|
|
We use MessageManager to decorate controls in a Form, and to display a consolidation of the error messages (roll up) in the header of the Form. We do this by adding validators to the data bindings of the controls, and add a listener to the status of the bindings. The listener posts the error messages to the MessageManager.
However, if, when the Form is being created and the related bindings are established, a validation error occurs, messages posted to the MessageManager are not displayed in the header. This is because of a check in MessageManager.update:
if (form.getHead().getBounds().height == 0 || mergedList.isEmpty() || mergedList == null) {
We establish the bindings in the "createPartControl" method of an EditorPart. When the bindings are created, the validators run, and we check the binding status for error, and post a message to the MessageManager. But the Form layout has not yet been computed, so the height of the header is zero.
My question whether there's any good reason for the check for height to be non-zero. It looks to me as though the only real action of the MessageManager.update is to call form.setMessage(), and that shouldn't depend on the height. In fact, if that check is commented out, it all works the way I expect (and want).
Any ideas on why that check in MessageManager.update exists, or why it shouldn't be removed?
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.03208 seconds