On Wednesday 10 February 2010 02:47:32 pm Jacek Kałucki wrote:
> Użytkownik John napisał:
> > Hi,
> >
> > In many of my dropdown's I only have to populate the Choices and Keys
> > once. IOW's the data is static.
> >
> > But I have discovered when I need to dynamicly populate dropdowns or
> > lists I need to subclass the dropdowns and provide my own update() - else
> > I will run into the dreaded value not in the selection. Something like
> > below.
> >
> > class ContactDropDown(dabo.ui.dDropdownList):
> >      def update(self):
> >          self.Clear()
> >          self.Choices,self.Keys = self.Form.contactChoices()
> >          self.super()
> >
> > First is this the best way to handle the situation where I need to
> > populate dynamic dropdowns?  Second I wonder if something should be added
> > to Framework to handle situations like I have described.  I'm not sure
> > how.  But I believe it happens often to many.
>
> Hi,
>
> In my application I do use set of such controls.
> They can act as lookup or bounded controls.
> They introduce property aka RowSource, well known from VFP.
> Currently they are based on following classes: dDropdownList, dListBox
> and dListControl.
> They are perfect for handle small amounts data from dynamic datasets.
> I use them e.g. for present lookup data stored in backend.
> I intended to put them on Wiki, but I'm still lacking in time.
> If you are interested in, I will send you few classes.
>
> Here is an example of bounded control use:
>      cDropdownList(
>          self,
>          DataSource="delivery_doc",
>          DataField="dd_doc_type_id",
>          BoundToBizobj=True,
>          RowSource=("documents", ("iid", "document_type")),
>          SetToFirstIfNone=True
>      )
>
> There are two bizobjs, primary "delivery_doc" and dynamically changed
> lookup "documents", and "dd_doc_type_id" field is FK field,
> and fields "iid", "document_type" are used as Keys and Choices source
> respectively.
> --
>
> Regards
> Jacek Kałucki

How about adding a filter?  I have been thinking along the same lines.

Johnf


_______________________________________________
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]

Reply via email to