- changed "Original Label Data Field" to use data binding
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 24 Jun 2014 08:00:55 +0000 (08:00 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 24 Jun 2014 08:00:55 +0000 (08:00 +0000)
 - added property change listener support for the field

.gitattributes
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataController.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataElement.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataField.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/OriginalLabelDataSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java

index 9b3a9a027040b28bd56f57176b3e53d7da0aaf7a..050a871d393fa3b3d0c8f58a463793286fda98b0 100644 (file)
@@ -1380,6 +1380,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/Lay
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MinMaxTextSection.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MultilanguageTextElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/NumberWithLabelElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PartialElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PointElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/RootElement.java -text
@@ -1397,8 +1398,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grant
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/AbstractCdmComposite.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/DerivedUnitGeneralDetailElementMVC.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/GeographicPointElement.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataController.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataField.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/combo/EnumTermCombo.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/combo/EnumTermComboController.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/element/DateElement.java -text
index fc199cb9dede7b084b5778351d0767191102f6a3..9344dffeabf5c66c3a341c302adff688881316be 100644 (file)
@@ -58,7 +58,12 @@ Require-Bundle: org.eclipse.osgi,
  org.eclipse.jface.text,
  org.eclipse.ui.forms,
  eu.etaxonomy.taxeditor.cdmlib,
- org.eclipse.nebula.widgets.compositetable;bundle-version="1.0.0"
+ org.eclipse.nebula.widgets.compositetable;bundle-version="1.0.0",
+ org.eclipse.core.databinding,
+ org.eclipse.core.databinding.beans,
+ org.eclipse.core.databinding.observable,
+ org.eclipse.core.databinding.property,
+ org.eclipse.jface.databinding
 Import-Package: org.eclipse.core.commands,
  org.eclipse.core.commands.operations,
  org.eclipse.core.expressions,
index c9662bdbcd2b676a881437280129dddbab02ea81..45b01cb383651b2247183702d48377d7892a2c5e 100644 (file)
@@ -99,8 +99,6 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
-import eu.etaxonomy.taxeditor.ui.mvc.OriginalLabelDataController;
-import eu.etaxonomy.taxeditor.ui.mvc.OriginalLabelDataElement;
 import eu.etaxonomy.taxeditor.ui.openurl.IOpenUrlEnabled;
 import eu.etaxonomy.taxeditor.ui.openurl.OpenUrlSelectorElement;
 import eu.etaxonomy.taxeditor.ui.password.EditPasswordElement;
@@ -2152,6 +2150,12 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
+    public OriginalLabelDataElement createOriginalLabelDataElement(ICdmFormElement parentElement) {
+        OriginalLabelDataElement element = new OriginalLabelDataElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
     public PreservedSpecimenDetailElement createPreservedSpecimenDetailElement(ICdmFormElement parentElement) {
         PreservedSpecimenDetailElement element = new PreservedSpecimenDetailElement(this, parentElement);
         addAndAdaptElement(parentElement, element);
@@ -2722,16 +2726,4 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    /**
-     * @param parentElement
-     * @return
-     */
-    public OriginalLabelDataController createOriginalLabelDataController(AbstractCdmDetailSection<DerivedUnitFacade> parentElement) {
-        OriginalLabelDataElement originalLabelDataElement = new OriginalLabelDataElement(parentElement.getLayoutComposite(), SWT.NONE);
-        originalLabelDataElement.initController(this, parentElement);
-        OriginalLabelDataController controller = originalLabelDataElement.getController();
-        addAndAdaptElement(parentElement, controller);
-        return controller;
-    }
-
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java
new file mode 100644 (file)
index 0000000..e5753d1
--- /dev/null
@@ -0,0 +1,63 @@
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.ui.element;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.mvc.OriginalLabelDataField;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ * @author pplitzner
+ * @date 17.06.2014
+ *
+ */
+public class OriginalLabelDataElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
+
+    private TextWithLabelElement textOriginalLabelData;
+
+    /**
+     * @param formFactory
+     * @param formElement
+     */
+    public OriginalLabelDataElement(CdmFormFactory formFactory,
+            ICdmFormElement formElement) {
+        super(formFactory, formElement);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
+     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
+     */
+    @Override
+    protected void createControls(ICdmFormElement formElement,
+            DerivedUnitFacade entity, int style) {
+        new OriginalLabelDataField(formElement.getLayoutComposite(), style, entity.innerDerivedUnit(), getFormFactory());
+//        textOriginalLabelData = formFactory.createTextWithLabelElement(formElement,
+//                "Original Label Data", entity.innerDerivedUnit().getOriginalLabelInfo(), SWT.MULTI);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
+     * .lang.Object)
+     */
+    @Override
+    public void handleEvent(Object eventSource) {
+        if (eventSource == textOriginalLabelData) {
+            getEntity().innerDerivedUnit().setOriginalLabelInfo(textOriginalLabelData.getText());
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataController.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataController.java
deleted file mode 100644 (file)
index 024482b..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2014 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.ui.mvc;
-
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.mvc.interfaces.CdmCompositeController;
-import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-
-/**
- * @author pplitzner
- * @date 17.06.2014
- *
- */
-public class OriginalLabelDataController extends AbstractCdmDetailElement<DerivedUnitFacade> implements CdmCompositeController, ModifyListener{
-
-    private final OriginalLabelDataElement originalLabelDataElement;
-
-    /**
-     * @param dateTimeElement
-     * @param formFactory
-     * @param parentElement
-     * @param initialDateTime
-     * @param none
-     */
-    public OriginalLabelDataController(CdmFormFactory formFactory, ICdmFormElement parentElement, OriginalLabelDataElement originalLabelDataElement, int style) {
-        super(formFactory, parentElement);
-        this.originalLabelDataElement = originalLabelDataElement;
-        this.originalLabelDataElement.getText().addModifyListener(this);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.element.IRelevantFormElement#setIrrelevant(boolean)
-     */
-    @Override
-    public void setIrrelevant(boolean irrelevant) {
-        // TODO Auto-generated method stub
-
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement#setEnabled(boolean)
-     */
-    @Override
-    public void setEnabled(boolean enabled) {
-        originalLabelDataElement.setEnabled(enabled);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement#isEnabled()
-     */
-    @Override
-    public boolean isEnabled() {
-        return originalLabelDataElement.isEnabled();
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, java.lang.Object, int)
-     */
-    @Override
-    protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
-        String originalLabelInfo = entity.innerDerivedUnit().getOriginalLabelInfo();
-        if(originalLabelInfo!=null){
-//            originalLabelDataElement.getText().setText(originalLabelInfo);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
-     */
-    @Override
-    public void modifyText(ModifyEvent e) {
-        getEntity().innerDerivedUnit().setOriginalLabelInfo(originalLabelDataElement.getText().getText());
-        firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
-     */
-    @Override
-    public void handleEvent(Object eventSource) {
-    }
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataElement.java
deleted file mode 100644 (file)
index a6b7531..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2014 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.ui.mvc;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-
-/**
- * @author pplitzner
- * @date 17.06.2014
- *
- */
-public class OriginalLabelDataElement extends AbstractCdmComposite<OriginalLabelDataController>{
-    private final Text text;
-
-    /**
-     * @param parent
-     * @param style
-     */
-    public OriginalLabelDataElement(Composite parent, int style) {
-        super(parent, style);
-        {
-            TableWrapLayout tableWrapLayout = new TableWrapLayout();
-            tableWrapLayout.verticalSpacing = 0;
-            tableWrapLayout.topMargin = 0;
-            tableWrapLayout.rightMargin = 0;
-            tableWrapLayout.leftMargin = 0;
-            tableWrapLayout.horizontalSpacing = 0;
-            tableWrapLayout.bottomMargin = 0;
-            tableWrapLayout.numColumns = 2;
-            setLayout(tableWrapLayout);
-        }
-
-        Label lblOriginalLabelData = new Label(this, SWT.NONE);
-        lblOriginalLabelData.setLayoutData(new TableWrapData(TableWrapData.RIGHT, TableWrapData.TOP, 1, 1));
-        lblOriginalLabelData.setText("Original Label Data");
-
-        text = new Text(this, SWT.BORDER | SWT.WRAP | SWT.MULTI);
-        text.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
-        new Label(this, SWT.NONE);
-
-        // TODO Auto-generated constructor stub
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.mvc.AbstractCdmComposite#initInternalController(eu.etaxonomy.taxeditor.ui.element.CdmFormFactory, eu.etaxonomy.taxeditor.ui.element.ICdmFormElement)
-     */
-    @Override
-    protected void initInternalController(CdmFormFactory formFactory, ICdmFormElement parentElement) {
-        controller = new OriginalLabelDataController(formFactory, parentElement, this, SWT.NONE);
-    }
-
-    public Text getText() {
-        return text;
-    }
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataField.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataField.java
new file mode 100644 (file)
index 0000000..725f840
--- /dev/null
@@ -0,0 +1,112 @@
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.mvc;
+
+import java.util.List;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.BeansObservables;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.jface.databinding.swt.SWTObservables;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+
+/**
+ * @author pplitzner
+ * @date 23.06.2014
+ *
+ */
+public class OriginalLabelDataField extends Composite {
+
+    private DataBindingContext m_bindingContext;
+    private eu.etaxonomy.cdm.model.occurrence.DerivedUnit derivedUnit = null;
+    private final Text originalLabelInfoText;
+    private CdmFormFactory formFactory;
+
+    public OriginalLabelDataField(Composite parent, int style, eu.etaxonomy.cdm.model.occurrence.DerivedUnit newDerivedUnit, CdmFormFactory formFactory) {
+        this(parent, style);
+        setDerivedUnit(newDerivedUnit);
+        this.formFactory = formFactory;
+    }
+
+    public OriginalLabelDataField(Composite parent, int style) {
+        super(parent, style);
+        setLayout(new GridLayout(2, false));
+
+        new Label(this, SWT.NONE).setText("Original Label Data");
+
+        originalLabelInfoText = new Text(this, SWT.BORDER | SWT.WRAP | SWT.MULTI);
+        originalLabelInfoText.addModifyListener(new ModifyListener() {
+            @Override
+            public void modifyText(ModifyEvent e) {
+                if(formFactory!=null){
+                    List<IPropertyChangeListener> propertyChangeListeners = formFactory.getPropertyChangeListeners();
+                    for (IPropertyChangeListener iPropertyChangeListener : propertyChangeListeners) {
+                        iPropertyChangeListener.propertyChange(new CdmPropertyChangeEvent(OriginalLabelDataField.this, e));
+                    }
+                }
+            }
+        });
+        originalLabelInfoText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+        if (derivedUnit != null) {
+            m_bindingContext = initDataBindings();
+        }
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+
+    private DataBindingContext initDataBindings() {
+        IObservableValue originalLabelInfoObserveWidget = SWTObservables.observeText(originalLabelInfoText, SWT.Modify);
+        IObservableValue originalLabelInfoObserveValue = BeansObservables
+                .observeValue(derivedUnit, "originalLabelInfo");
+        //
+        DataBindingContext bindingContext = new DataBindingContext();
+        //
+        bindingContext.bindValue(originalLabelInfoObserveWidget, originalLabelInfoObserveValue, null, null);
+        //
+        return bindingContext;
+    }
+
+    public eu.etaxonomy.cdm.model.occurrence.DerivedUnit getDerivedUnit() {
+        return derivedUnit;
+    }
+
+    public void setDerivedUnit(eu.etaxonomy.cdm.model.occurrence.DerivedUnit newDerivedUnit) {
+        setDerivedUnit(newDerivedUnit, true);
+    }
+
+    public void setDerivedUnit(eu.etaxonomy.cdm.model.occurrence.DerivedUnit newDerivedUnit, boolean update) {
+        derivedUnit = newDerivedUnit;
+        if (update) {
+            if (m_bindingContext != null) {
+                m_bindingContext.dispose();
+                m_bindingContext = null;
+            }
+            if (derivedUnit != null) {
+                m_bindingContext = initDataBindings();
+            }
+        }
+    }
+
+}
index d0284f486cb3b2c939e2e303e897249ed0a47eb0..e4c1602b27a5eaa2319885d334bf5a6e3fd4eb38 100644 (file)
@@ -51,7 +51,7 @@ public class OriginalLabelDataSection extends AbstractCdmDetailSection<DerivedUn
      */
     @Override
     protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
-        return formFactory.createOriginalLabelDataController(parentElement);
+        return formFactory.createOriginalLabelDataElement(parentElement);
     }
 
 }
index 285fd520e215a93de38eb167bf549f091793380a..53e294b551735e856982c156c5b3a267d4516494 100644 (file)
@@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.view.detail;
 
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.forms.SectionPart;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
@@ -120,15 +121,23 @@ public class CdmSectionPart<T> extends SectionPart implements
                if (event != null) {
 
                        Object eventSource = event.getSource();
+                       Control[] children = formSection.getLayoutComposite().getChildren();
+                       boolean containsElement = false;
+                       for (Control control : children) {
+                           if(eventSource.equals(control)){
+                               containsElement = true;
+                               break;
+                           }
+            }
+                       if(containsElement){
+                           markDirty();
+                       }
 
-                       if (formSection.equals(eventSource)){
+                       else if (formSection.equals(eventSource)){
                                markDirty();
                        }
-                       if((
-                                               (eventSource instanceof ICdmFormElement)
-                                               && formSection.containsFormElement((ICdmFormElement) eventSource))
-                                               ) {
-                               markDirty();
+                       else if(((eventSource instanceof ICdmFormElement)&& formSection.containsFormElement((ICdmFormElement) eventSource))) {
+                           markDirty();
                        }
                }
        }