Description:
------------
I have a small problem here. I have a table with multiple primary keys and one of the keys is a link to another table, the formbuilder integration displays the link allright as linkDisplayName. But now I no longer have access to the original value of the field, which I need for edit link generation (remember the field is part of the primary key). Could it be possible to make the original value available in the record? I have written a small patch, that adds this information to the magic value __links__ in the record array. I don't know though if this is the right strategy. One could also set up the dataobject manually, add the link field with another name, add that to datagrid for display and still fetch the original field via the fields options.
Test script:
---------------
// Get Linked FormBuilder Fields
if ($this->_options['formbuilder_integration']) {
+ $values = array();
foreach (array_keys($rec) as $field) {
if (isset($links[$field]) &&
isset($this->_dataobject->$field) &&
$linkedDo =& $this->_dataobject->getLink($field) &&
!PEAR::isError($linkedDo)) {
- $rec[$field] = DB_DataObject_FormBuilder::getDataObjectString($linkedDo);
+ $values[$field] = $rec[$field];
+ $rec[$field] = DB_DataObject_FormBuilder::getDataObjectString($linkedDo);
}
}
+ if ($values) {
+ $rec['__links__'] = $values;
+ }
}

Comments

Hello Jan,
For various reasons, the record array cannot contain sub arrays such as the __links__ you propose.
However, I've added the link_keep_value option (in CVS). When set to true it will add "myfield__orig" keys to the record array. This way you can either display them on the table and/or use them in a column formatter.
Thanks for your report