N°3750 Add data-input-id to field container

This will allow easiest DOM manipulation in BeHat tests
This commit is contained in:
Pierre Goiffon
2021-02-24 17:13:47 +01:00
parent 8295920c3c
commit c8911f1fa9
4 changed files with 29 additions and 17 deletions

View File

@@ -337,7 +337,12 @@ class Field extends UIContentBlock
public function SetValueId(?string $sValueId)
{
$this->sValueId = $sValueId;
return $this;
}
public function SetInputId(string $sInputId)
{
$this->AddDataAttribute('input-id', $sInputId);
}
}

View File

@@ -31,6 +31,7 @@ class FieldUIBlockFactory extends AbstractUIBlockFactory
'attlabel' => 'SetAttLabel',
'value_raw' => 'SetValueRaw',
'comments' => 'SetComments',
'inputId' => 'SetInputId',
];
foreach ($aParamsMapping as $sParamKey => $sFieldMethod) {
self::UpdateFieldFromParams($oField, $sFieldMethod, $aParams, $sParamKey);