Community
Participate
Working Groups
Build Identifier: 20110218-0911 Hi, I'm using Eclipse 3.6 / EMF 2.6 / GMF 2.2 My issue is that when I implement live validation using a JAVA or OCL constraint on a EBoolean field, the error message appears twice. I've tracked the problem, and its root is in the UndoableModelPropertySheetEntry. Here is how it happens : I set an incorrect value in a EBoolean field. The setValue method launches the valueChangedCommand, which triggers the validation. The ERROR status is correctly initialized. Then I come back to the setValue method, and as I have a non OK status, the newValue is not set in the editValue. This part is correct. But in fact the CCombo which is used as an editor for this property has not its selectionIndex reset to the correct value. To get out of this property field, I had to click somewhere else, for example in the editor. Consecutively to this first value change, when the editor is activated, it triggers the value changed again on the field. As the property relies on the selection index (which is not resetted in the meantime) it tries again to set the wrong value, and triggers the validation again. So a correct solution would be to reset the correct selection index, for example by doing so in the UndoableModelPropertySheetEntry : else { editor.setValue(editValue); } after the line : if (status.isOK()) editValue = newValue; Or change the behaviour so the change of active part doesn't trigger the change of value a second time (more complicated I guess). At first the correct selection index is set in the getEditor method in PropertySheetEntry. Reproducible: Always Steps to Reproduce: 1. On an existing GMF diagram example (I reproduced my problem on a simple mindmap example I can provide), add an EBoolean attribute to a class 2. Create an audit rule, and an audit constraint that checks this value is always <> true ou <> false (depending on the default value) 3. In the gmfgen, modify the Gen Diagram to ensure that Live Validation and Live Validation UI Feedback are set to true 4. Regenerate and run the application. Create a figure of the concerned class, and change the boolean attribute in the properties view 5. If the 2 windows don't appear consecutively, click on the editor after the first one.