Paul McNett wrote:
> johnf wrote:
>> Doesn't it make sense that a list type control should be able to use a
>> dataset? Often the control is associated with data retrieved from a table.
>> But the data retrieved must be massaged. Just a thought I had.
>
> Yes and I have always intended to pursue that. But Keys and Choices were
> so easy to use that I never expanded on it to make it more automatic. My
> original thought was to have, in addition to:
>
> DataSource:
> The bizobj that contains the field to save the value (the selection in
> the list) to.
>
> DataField:
> The field that we save the value (the selection in the list) to.
>
> RowSource:
> The bizobj that contains the rows to present as choices.
>
> RowField:
> The field in the bizobj that we display as choices (could be a
> VirtualField).
>
> RowKey:
> The field in the RowSource bizobj to use as the Value (to save to
> DataField).
>
> Like I said, I think this sounds like a nice addition to
> dControlItemMixin, but never had time to continue the thought. What do
> you think of this design though?
>
> Paul
It's too easy to create a specialized class for that purpose.
So no, i don't think that a generalized dropdownlist fits into the
framework (Dabo). Of cause if i would need it too often i would already
have such a dropdownlist class. Instead i put effort into were the
display data comes from.
There are too many ways to manage the list data.
To fill the data i'm using a 2-liner:
choices, keys = self.Form.enumBiz.getEnumsByToken('e_sex')
sexbox = dabo.ui.dComboBox(self, DataSource="JNP", DataField="e_sex",
Choices=choices, Keys=keys, ValueMode='Key')
The real work went into getEnumsByToken() and the underlying data structure.
Uwe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]