Extending the select widget-type
5 posts
• Page 1 of 1
I've been testing dataface and I'd like to give you lots of credit for this application. I'm already planning to implement a couple of databases in dataface.
But I miss one feature though, which for me will be a significant enhancement of dataface: I'd like to use a database table as the source for the select widget. When I've been designing web interfaces for databases I have many times used select-widgets like these: Element A Element B Element C Element D Element E Element F The id-attr is a unique key in the source table, and the option text "Element " is from another column in the table. Would you consider implementing a select-widget like this in the near future?
If I understand you right, this already exists. Have a look here, http://framework.weblite.ca/documentation/tutorial/getting_started/valuelists , at Example 3.
Regards Neil
If I understand you right, this already exists. Have a look here, http://framework.weblite.ca/documentation/tutorial/getting_started/valuelists , at Example 3.
You could obviously skip the id attribute (and hence the id column) in the option tag if the contents of the desc column is unique. I hope I've provided a more understandable description of my wish now...
Define your valuelist as follows:
[my_valuelist] __sql__ = "select id,desc from my_table" Then in your fields.ini file, define your field as follows: [my_field] widget:type = select vocabulary = my_valuelist This will give you a select list like you describe above. -Steve
5 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 10 guests |