Hi,
1.
I don't know how works the
function xxx__getAddableValues(Dataface_Record $record){}
With xxx is a name field followed by two underscores.
I think it's a good start to check documentation or the code-source
./Dataface/DelegateClass.php
2.
For my part, I use function valuelist__xxx
With xxx is a valuelist name declared in valuelists.ini (don't forget, there is two underscores).
function valuelist__xxx(){
$query = Dataface_Application::getInstance()->getQuery();
// you can mix both vocabulary defined in valuelists.ini and an other valuelist for only records edited on relationship
// if you want to change the value only when the user edited related records on relationship relABC
if ( array_key_exists('-relationship', $query) && $query['-relationship'] == 'relABC' ){
$app =& Dataface_Application::getInstance();
$currentrecord =& $app->getRecord();
if (! isset($currentrecord)) { return null; }
// you can add filter
// for example, you want all the values of the columnV (v as values) from the table tableXYZ only where a column columnC (c as condition) have the exact value valueEV (ev as exact value)
$newlist = df_get_records_array('tableXYZ', array('columnC'=>'=valueEV'')); // note the "=" after "=>"
$out = array();
foreach ( $newlist as $li){
$out[$li->val('id')] = $li->val('columnV'); // note : in the fields.ini : [columnV] widget:type = select
}
return $out;
}
}
Try the simpliest (without filter, without check relationship) and adapt gradually.
-
Ti