From: Matthieu S. (JIRA) <no...@sp...> - 2010-03-31 12:00:35
|
Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. -------------------------------------------------------------------------------------------------------------------------------------------------- Key: RCP-631 URL: https://jira.springsource.org/browse/RCP-631 Project: Spring Rich Client Project Issue Type: Bug Components: Core Affects Versions: 1.1.0 Reporter: Matthieu Steyt Assignee: Lieven Doclo Priority: Major Consider the following example: A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: 1. valueChangeEvents of A are delivered 2. A is cleared (dirty = false) 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) 4. B is cleared (dirty = false) Result: A is dirty, while it is the intention of the method that A is cleared. Solution: Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Lieven D. (JIRA) <no...@sp...> - 2010-03-31 12:29:36
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52560#action_52560 ] Lieven Doclo commented on RCP-631: ---------------------------------- After changing to the suggested solution, one of the tests is failing: testSetFormObjectUpdatesDirtyState on AbstractFormModelTests. This test actually mimics the behavior as shown, but revolves around the assumption that the object should be dirty: if the object composed by the valuemodels in a formmodel isn't the same as the object that was used to create said formmodel, it should be dirty. [code] fm.getValueModel("simpleProperty").addValueChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { fm.getValueModel("singleSelectListProperty").setValue(null); } }); TestBean newBean = new TestBean(); newBean.setSimpleProperty("simpleProperty"); newBean.setSingleSelectListProperty("singleSelectListProperty"); fm.setFormObject(newBean); assertEquals(null, fm.getValueModel("singleSelectListProperty").getValue()); assertTrue(fm.isDirty()); [/code] When your solution would be used, the last statement would return false, while the valuemodel's value (null) isn't the same as the original value ("singleSelectListProperty") which means it should be dirty. > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Lieven Doclo > Priority: Major > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Geoffrey De S. (JIRA) <no...@sp...> - 2010-03-31 12:43:34
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Geoffrey De Smet resolved RCP-631. ---------------------------------- Resolution: Complete Fix Version/s: 1.1.1 Assignee: Geoffrey De Smet (was: Lieven Doclo) fixed by Matthieu > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Geoffrey De S. (JIRA) <no...@sp...> - 2010-03-31 12:45:34
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Geoffrey De Smet reopened RCP-631: ---------------------------------- reopened, Matthieu is looking at Lieven's comment before resolving > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Lieven D. (JIRA) <no...@sp...> - 2010-03-31 13:19:36
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52563#action_52563 ] Lieven Doclo commented on RCP-631: ---------------------------------- Can you comment a simple use case for this issue? > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Matthieu S. (JIRA) <no...@sp...> - 2010-03-31 14:00:37
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthieu Steyt updated RCP-631: ------------------------------- Attachment: AbstractFormModelTests.java.patch It seems that this test case has been lucky for a long time... After switching the role of the two properties in this test case, it fails. This because simpleProperty is always cleared after singleSelectListProperty (this as a side effect of the used Map implementation used to hold the mediatingValueModels). See attachment for a patch containing such a switch. So, as it seems that the behaviour as tested in testSetFormObjectUpdatesDirtyState has never worked correctly, the question is : what should be the correct behaviour? The javadoc states "Disconnect view from data in MediatingValueModels, possibly clearing them afterwards.", so I expect all valuemodels to be cleared after calling this method with clearValueModels = 'true' The use case is simple, after calling setFormObject() on the formmodel I expect the formmodel to be 'not dirty'. > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > Attachments: AbstractFormModelTests.java.patch > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Jan H. (JIRA) <no...@sp...> - 2010-03-31 14:18:35
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52567#action_52567 ] Jan Hoskens commented on RCP-631: --------------------------------- The same goes for the opposite: when setting a formobject, a propertyChangeListener updates some value which needs to be confirmed by the user. Hence expect the formModel to be dirty because of the property change listener. Not sure which way to go yet. Additionally I would expect a default object to be complete, hence if you set a formObject, it should contain all values. When property change listeners fire, it would only set the same default value and this won't trigger a dirty if done correctly. Or is this not the case? This might need some more thought before a complete solution pops up... > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > Attachments: AbstractFormModelTests.java.patch > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Lieven D. (JIRA) <no...@sp...> - 2010-03-31 14:31:35
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52568#action_52568 ] Lieven Doclo commented on RCP-631: ---------------------------------- Depends on what you consider to be dirty. So in your case, say you have a dummy object X(A=1, and B=2) and you set this bean on a formmodel that sets the value of B to 3 whenever A is changed through a valuechangelistener. The following will fail: {code} X x = new X(); ... // sets values of A=1 and B=2 formModel.setFormObject(x); if(!formModel.isDirty) // formModel isn't dirty, so one would assume no values have been changed { assertEquals(x, formModel.getFormObject); // fails because B is 3 now, although the form model is not dirty } {/code} I would assume that when the formmodel isn't dirty, the object behind the formmodel hasn't been changed. With your changes, I can't be sure anymore, as listeners on the formmodel may have altered the object... > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > Attachments: AbstractFormModelTests.java.patch > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Lieven D. (JIRA) <no...@sp...> - 2010-03-31 14:33:34
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52569#action_52569 ] Lieven Doclo commented on RCP-631: ---------------------------------- _They really should enable comment editing again_ Depends on what you consider to be dirty. So in your case, say you have a dummy object X(A=1, and B=2) and you set this bean on a formmodel that sets the value of B to 3 whenever A is changed through a valuechangelistener. The following will fail: {code} X x = new X(); ... // sets values of A=1 and B=2 formModel.setFormObject; if(!formModel.isDirty) // formModel isn't dirty, so one would assume no values have been changed { assertEquals(x, formModel.getFormObject); // fails because B is 3 now, although the form model is not dirty } {code} I would assume that when the formmodel isn't dirty, the object behind the formmodel hasn't been changed. With your changes, I can't be sure anymore, as listeners on the formmodel may have altered the object... > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > Attachments: AbstractFormModelTests.java.patch > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Geoffrey De S. (JIRA) <no...@sp...> - 2010-04-01 07:28:35
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52592#action_52592 ] Geoffrey De Smet commented on RCP-631: -------------------------------------- I agree with these 3 arguments: * Matthieu: 1) The current for loop is unstable because it is order dependend (and the order is undefined) * Lieven, Jan: 2) After setting a formObject, the formObject can be dirty (due to listeners) * ?: 3) The original author of boolean clearValueModels was fixing a problem, we have to make sure we don't regress that problem Examples to prove some of those arguments * 1) See Matthieu's patch which simply breaks on the order in which the user code calls listeners * 2) A Contact (think Thunderbird) has a property firstName, lastName, displayName. ** if displayName is empty and firstName or lastName are changed, then displayName = firstName + " " + lastName ** if the db has a row: firstName = "Kabouter", lastName = "Plop", displayName = "" *** then it will be shown to the user in the form as firstName = "Kabouter", lastName = "Plop", displayName = "Kabouter Plop" *** In that case the save button should be enabled (so it should be dirty) **** because otherwise if you send a mail to that contact, the display name of that contact is not the displayName shown in the unsaved form, "Kabouter Plop" > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > Attachments: AbstractFormModelTests.java.patch > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Matthieu S. (JIRA) <no...@sp...> - 2010-04-02 08:15:35
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52615#action_52615 ] Matthieu Steyt commented on RCP-631: ------------------------------------ Reconsider the example with object X x1 = new X(id=1, A=a1(id=5), B=10) with A another domain object and you set this bean on a formmodel that sets the value of A to an instance a2 with id=5 (fresh from a db back-end) when B=10 (this is necessary for user interaction with the form) and of course a2.equals(a1). But as the value change detector checks on java instance equality (==) instead of using the equals() implementation our formmodel will be dirty after setting x1 on it. I don't think this is desired behaviour. One could say, use a value change detector that uses equals(), but: * does not work with referables/derived valuemodels (when you change a property on the referred entity, you expect the derived value model to change even if oldEntity.equals(newEntity)) * a considerable amount of bindings make intensive use of cloning to make a valuemodel clear that something has changed... which will break if you use a value change detector that uses equals()... > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > Attachments: AbstractFormModelTests.java.patch > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Matthieu S. (JIRA) <no...@sp...> - 2010-04-07 07:44:34
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52723#action_52723 ] Matthieu Steyt commented on RCP-631: ------------------------------------ Can we take a decision here? This is quite important for us... > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > Attachments: AbstractFormModelTests.java.patch > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Lieven D. (JIRA) <no...@sp...> - 2010-04-08 19:52:01
|
[ https://jira.springsource.org/browse/RCP-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52791#action_52791 ] Lieven Doclo commented on RCP-631: ---------------------------------- Matthieu, I think the best solution in this case would be if the formmodel had a switch that enables this behavior. The default setting should produce the behavior as it is now, in the alternate setting it should assume that after setting a formobject the formmodel should never be dirty. Any thoughts on this? > Clearing the valuemodels in AbstractFormModel#setDeliverValueChangeEvents(boolean,boolean) should occur after all ValueChangeEvents are delivered. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RCP-631 > URL: https://jira.springsource.org/browse/RCP-631 > Project: Spring Rich Client Project > Issue Type: Bug > Components: Core > Affects Versions: 1.1.0 > Reporter: Matthieu Steyt > Assignee: Geoffrey De Smet > Priority: Major > Fix For: 1.1.1 > > Attachments: AbstractFormModelTests.java.patch > > > Consider the following example: > A formmodel containing two valuemodels A and B. B has a changelistener registered in which A gets a new value. The current implementation of the setDeliverValueChangeEvents(boolean,boolean) method uses the following sequence: > 1. valueChangeEvents of A are delivered > 2. A is cleared (dirty = false) > 3. valueChangeEvents of B are delivered, as a consequence A is adapted (back to dirty) > 4. B is cleared (dirty = false) > Result: > A is dirty, while it is the intention of the method that A is cleared. > Solution: > Two for-loops instead of one. One for firing the events and one for clearing the value models. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |