On 8/15/11 12:38 PM, Paul McNett wrote:
>> > that's my point. I'd like to use the field as a flag as part of a series
>> > of
>> > flags (even considered a state machine). But now I need a field to tell
>> > me if
>> > there were any changes.
> def isFieldChanged(self, field_name, row=None):
> return self.getFieldVal(field_name, row) != self.oldVal(field_name, row)
...and if you want to find out, without asking, at the time a field value
changes,
something like this should work:
class FieldValueChanged(dabo.dEvents.dEvent): pass
class MyBizobj(...):
def afterSetFieldVal(self, fld, row):
self.raiseEvent(FieldValueChanged, table=self.DataSource, field=fld,
row=row)
class MyForm(...):
def afterInit(self):
...
self.bindEvent(FieldValueChanged, self.onFieldValueChanged)
def onFieldValueChanged(self, evt):
table = evt.EventData.table
field = evt.EventData.field
row = evt.EventData.row
# do stuff to visually indicate the change
(untested but you get the gist)
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]