Ed Leafe wrote:
On Jan 24, 2006, at 2:05 PM, Henning Hraban Ramm wrote:

Is there already a possibility to use a 'list' field type (with FieldSpecEditor or else)?
I need that e.g. for 'set' types or for lists from other tables.

No, there isn't. I've thought about this in the past, and could never come up with a clean interface for specifying the list source. I thought of adding a pre-defined method to the form that would be called with the field name when the form was created, which would then return the list of choices for that field. It would then be up to the developer to code that method in the generated form code with the appropriate logic. But I never got around to adding it, and then Paul took over the AppWizard development, and I haven't thought about it since.

What do you think about that solution? If a field is designated as a 'list' type, the developer would have to be responsible for writing method code that would accept the field name as a parameter, and return a list to be used to populate the list. We could even specify two types of list: 'list' and 'ddlist', with the former creating a ListBox and the latter creating a dropdown list.

Currently, datanav.form defines three methods that could be of interest:

getEditClassForField(self, fld) --> class to use on edit page
getSelectControlClassForField(self, fld) --> class to use on select page
getSelectOptionsForField()(self, fld) --> options for use in the select options dropdown

I've used getEditClassForField() to return dropdown lists and radio groups, set with their Choices filled in from a lookup bizobj and their DataSource and DataField set to the master bizobj. Pick an item from the dropdown, and the key value propagates to the master bizobj.


Similarly, I've used getSelectControlClassForField() to put a radio box of choices to select from in the select page.

This isn't exactly what you are talking about here, but I just wanted to point out what already exists.


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to