dabo Commit
Revision 2356
Date: 2006-10-16 11:09:25 -0700 (Mon, 16 Oct 2006)
Author: paul
Changed:
U trunk/dabo/ui/dDataControlMixinBase.py
Log:
If you set the value of a bound control programatically, it wasn't getting
propagated to the bizobj. Fixed.
Diff:
Modified: trunk/dabo/ui/dDataControlMixinBase.py
===================================================================
--- trunk/dabo/ui/dDataControlMixinBase.py 2006-10-16 14:34:38 UTC (rev
2355)
+++ trunk/dabo/ui/dDataControlMixinBase.py 2006-10-16 18:09:25 UTC (rev
2356)
@@ -195,7 +195,7 @@
nm =
str(self.DataSource)
dabo.errorLog.write("Could not bind to '%s.%s'" % (nm, self.DataField) )
- self._afterValueChanged()
+ self._afterValueChanged(_from_flushValue=True)
# In most controls, self._oldVal is set upon GotFocus. Some
controls
# like dCheckBox and dDropdownList don't emit focus events, so
@@ -256,7 +256,7 @@
return "?"
- def _afterValueChanged(self):
+ def _afterValueChanged(self, _from_flushValue=False):
"""Called after the control's value has changed.
This is defined as one of:
@@ -265,7 +265,7 @@
User code shouldn't need to access or override this.
"""
-
+
# Maintain an internal copy of the value, separate from the
# property, so that we still have the value regardless of
whether
# or not the underlying ui object still exists (in wx at least,
@@ -277,6 +277,10 @@
# Raise an event so that user code can react if needed:
self.raiseEvent(dabo.dEvents.ValueChanged)
+ if not _from_flushValue and self.Form.ActiveControl != self:
+ # Value was changed programatically - flushValue won't
be called
+ # automatically so do it explicitly now.
+ self.flushValue()
# Property get/set/del methods follow. Scroll to bottom to see the
property
# definitions themselves.
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev