Commit 318f0f30 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#2542 / FormElement-Typ 'note' funktioniert nicht mit dynamic update

''abel' and 'note' are fixed - 'value' is still not updated, open.
HelperFormElement.php: buildFormElementName() had some issue if there was no $formElement[FE_NAME] defined. New workaround: take the $formElement[FE_ID] instead.
AbstractBuildForm.php: creation of JSON has been missed - now fixed. The $value is rendered (recent value), but probably the client is not prepared to update a non-HTML-input field. This has to debug with RO.
parent d77061e4
......@@ -436,7 +436,7 @@ abstract class AbstractBuildForm {
// Typically: $htmlElementNameIdZero = true
// After Saving a record, staying on the form, the FormElements on the Client are still known as '<feName>:0'.
$htmlFormElementName = HelperFormElement::buildFormElementName($formElement[FE_NAME], ($htmlElementNameIdZero) ? 0 : $recordId);
$htmlFormElementName = HelperFormElement::buildFormElementName($formElement, ($htmlElementNameIdZero) ? 0 : $recordId);
$formElement[FE_HTML_ID] = HelperFormElement::buildFormElementId($this->formSpec[F_ID], $formElement[FE_ID], ($htmlElementNameIdZero) ? 0 : $recordId, 0);
// Construct Marshaller Name: buildElement
......@@ -2791,6 +2791,8 @@ abstract class AbstractBuildForm {
* @return mixed
*/
public function buildNote(array $formElement, $htmlFormElementName, $value, array &$json, $mode = FORM_LOAD) {
$json = $this->getFormElementForJson($htmlFormElementName, $value, $formElement);
//
return Support::wrapTag("<div class='" . CLASS_NOTE . "'>", $value);
}
......
......@@ -68,7 +68,9 @@ class HelperFormElement {
* @param string $id
* @return string
*/
public static function buildFormElementName($field, $id) {
public static function buildFormElementName(array $formElement, $id) {
$field = ($formElement[FE_NAME] == '') ? $formElement[FE_ID] : $formElement[FE_NAME];
return "$field" . HTML_DELIMITER_NAME . "$id";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment