The Data Dictionary is very useful for producing specialized HTML. One of the more tiresome tasks of database development is the need to make up specialized inputs for many different fields, with different rules for different types, different alignment, different sizes, and so on.
Andromeda provides the input() function which can be used to generate consistent standardized inputs based on the information in the data dictionary.
<?php
class x6example extends androX6 {
function x6main() {
# Load the dictionary
$dd = ddTable('configfw');
# Now dump a simple input for each column
# in the table
$top = html('div');
foreach($dd['flat'] as $colname=>$colinfo) {
$top->h('div',$colinfo['description'].':');
$input = input($colinfo);
$top->addChild($input);
}
$top->render();
}
}
?>
Each input has special attributes that can be used by browser-side code for whatever purpose you may need. These custom attributes always have the letter 'x' as a prefix to their name. They generally have the same name as data dictionary properties except they lack underscores:
You can make use of the special attributes that Andromeda adds to its inputs to easily find controls that correspond to certain database columns.
If you want to find the input that is bound to the column "group_id" in table "groups", the following jQuery selector will do that: