main logo
Subject: Re: [dabo-users] Backgroundcolor of a form
Author: Ed Leafe
Posted: 2008/01/31 12:33:20
 
View Entire Thread
New Search


On Jan 31, 2008, at 11:22 AM, Paul McNett wrote:

> This function will be
> evaluated at the proper time by Dabo to dynamically determine the
> value
> of the property.

"At the proper time" == update()

Let's say you have a form displaying your Customers. It would be cool
if the form's Caption reflected the currently-selected customer, so to
do this you would write:

def afterInit(self):
self.DynamicCaption = self.getCurrentCustomer

def getCurrentCustomer(self):
return "Editing: %s" % self.PrimaryBizobj.Record.cust_name

Now as you navigate or requery, selecting a record fires the update()
method, causing all controls to display the current record's values,
and will also update the form's Caption property with the value
returned by getCurrentCustomer().

Other common uses are DynamicEnabled/DynamicVisible that are tied to
permissions; DynamicBack/ForeColor to highlight items that need
attention or to display a visual status cue; DynamicHeight/Width/Left/
Right to control sizing/positioning of an object to reflect some other
status/condition; ...

-- Ed



 
©2008 Ed Leafe
<-- Prior Message New Search Next Message -->