5102 Posts in 1520 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 757 Views |
-
CMS: somethingHasChanged=true but nothing has changed! [SOLVED]

3 May 2010 at 8:50pm Last edited: 15 May 2010 8:18am
Hi,
I extended a ComplexTableField and use this object in a CMS page. Everything works fine - all items are displayed correctly, all actions are working correctly. But when I click on "edit" in the CTF and close the popup without any changes and navigate to another sitetree-object, I receive the status-message that something has changed.
Therefore, I assume that the action "edit" changes the flag "isChanged" on the Editform, but I didn´t find the code yet. Can anybody help me to understand this process?
Best regards,
chrclaus -
Re: CMS: somethingHasChanged=true but nothing has changed! [SOLVED]

11 May 2010 at 8:56pm Last edited: 11 May 2010 8:56pm
Hi there,
there is a bug report that relates to this. It seems to me like there is a proposed way to work with/around this as well.
http://open.silverstripe.org/ticket/4810
Hope this helps.
Regards,
Chris -
Re: CMS: somethingHasChanged=true but nothing has changed! [SOLVED]

15 May 2010 at 8:15am Last edited: 15 May 2010 8:17am
Hi,
this was a very good hint with which I found the underlying problem. There are several hidden input-fields in the ComplexTableField and both of them caused the status-message. These fields are PopupHeight and PopupWidth which are not changed at all but both of them are re-initialized after the popup is closed and the ajax-respond causes the CMS-Admin-page to update its status. During debugging I found an array of field-to-ignore this is the solution for my post. With javascript, both fields are added to this list (ArticlesComplexTableField is specialisation of ComplexTableField by me):
ArticlesComplexTableField = Class.create();
ArticlesComplexTableField.applyTo('#Form_EditForm div.ArticlesComplexTableField');
ArticlesComplexTableField.prototype = {
initialize: function() {
Behaviour.register({
'#Form_EditForm' : {
changeDetection_fieldsToIgnore : {
'PopupHeight' : true,
'PopupWidth' : true
}
}
});
},
}
| 757 Views | ||
|
Page:
1
|
Go to Top |

