Set values on readonly/disabled fields

These field variations are not corresponding to properties on the underlying DataObject,
hence need to be set manually. At the moment, Form->loadDataFrom() is never called during schema generation,
so the setValue() calls are required for all fields - which is a bug in the LeftAndMain->schema() implementation.
This commit is contained in:
Ingo Schommer 2016-10-14 07:47:57 +13:00
parent fbae8eef90
commit ccbbd91822

View File

@ -263,11 +263,13 @@ class BasicFieldsTestPage extends TestPage
$disabledField = $field->performDisabledTransformation();
$disabledField->setTitle($disabledField->Title() . ' (disabled)');
$disabledField->setName($disabledField->getName() . '_disabled');
$disabledField->setValue($field->Value());
$tabObj->insertAfter($disabledField, $field->getName());
$readonlyField = $field->performReadonlyTransformation();
$readonlyField->setTitle($readonlyField->Title() . ' (readonly)');
$readonlyField->setName($readonlyField->getName() . '_readonly');
$readonlyField->setValue($field->Value());
$tabObj->insertAfter($readonlyField, $field->getName());
}
}