The afterinit is for what object? 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Carey Gagnon
> Sent: Sunday, July 12, 2009 6:01 PM
> To: Dabo Users list
> Subject: Re: [dabo-users] Very Simple dropdownlist
> 
> Still no luck. This is the code now:
> 
> def afterInit(self):
>     statesdropdown = SPLDropdown(self, DataSource = 
> ClientBizobj, DataField = "stateprov")
>     locations = ({"state": "Select", "iid": 0},
>             {"state": "Ak", "iid": 1},
>         {"state": "Ga", "iid": 2},
>         {"state": "Tx", "iid": 3})
> 
>     choices = []
>     keys = {}
>     for location in locations:
>         choices.append("%s" % (location['state']))
>         keys[location["iid"]] = len(choices) - 1
>     self.Choices = choices
>     self.Keys = keys
>     self.ValueMode = "key"
> 
> #####################################
> 
> SPLDropdown is the RegID I gave to the drop down list.
> 
> Now I get the error:
> NameError: global name 'SPLDropdown' is not defined
> 
> 
> N00bs R Us
> Carey
> 
> 
> 
> On Sun, Jul 12, 2009 at 4:31 PM, Ed Leafe <[email protected]> wrote:
> 
> > On Jul 12, 2009, at 4:19 PM, Carey Gagnon wrote:
> >
> > > So even a static (for lack of a better phrase) drop down 
> needs to be 
> > > bound to the bizobj in order to be wrtten to the database on save?
> >
> >         Yes. A control is just a dumb UI object. However, you can 
> > enable data binding by setting two properties: DataSource and 
> > DataField. These determine the object and property, 
> respectively, that 
> > the control is bound to. In the most typical case, 
> 'DataSource' is the 
> > same as the bizobj's DataSource (the form will figure this 
> out at run 
> > time), and 'DataField' is the column in the data that the control's 
> > Value should be bound to. Just by setting those two properties you 
> > transform a dumb UI control into a powerful data 
> display/editing tool.
> >
> >
> > -- Ed Leafe
> >
> >
> >
> >
> >
[excessive quoting removed by server]

_______________________________________________
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/!~!uenerkvcmdkaaqacaaaaaaaaaaaaaaaaabgaaaaaaaaaafa2fnyupuomnfpiynbeqckaaaaqaaaaobwz+4orak+pzgmyys81cweaa...@charter.net

Reply via email to