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
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at https://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/e66c5dff-8d7c-48b8-9abb-069cd76557b4%40googlegroups.com.