N°3979 - Handle initial values on dependent fields (#325)

N°3979 - Handle initial values on dependent fields
This commit is contained in:
Anne-Catherine
2022-08-12 17:48:53 +02:00
committed by GitHub
parent b91ab8940e
commit bacdd63dd4
3 changed files with 24 additions and 10 deletions

View File

@@ -25,6 +25,7 @@ use AttributeDuration;
use Combodo\iTop\Application\Helper\WebResourcesHelper;
use Combodo\iTop\Application\UI\Base\Component\Field\FieldUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
use Combodo\iTop\Application\UI\Base\Component\Html\HtmlFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\Select\SelectOptionUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Input\SelectUIBlockFactory;
@@ -111,15 +112,17 @@ class ConsoleSimpleFieldRenderer extends FieldRenderer
$bRichEditor = ($this->oField->GetFormat() === TextAreaField::ENUM_FORMAT_HTML);
$oText = new TextArea("",$this->oField->GetCurrentValue(),$this->oField->GetGlobalId(),40,8);
$oText->AddCSSClass('ibo-input-field-wrapper ibo-input');
$oValue->AddSubBlock($oText);
if ($this->oField->GetReadOnly())
{
$oText->SetIsDisabled(true);
$oValue->AddSubBlock(UIContentBlockUIBlockFactory::MakeStandard())->AddSubBlock(HtmlFactory::MakeHtmlContent($this->oField->GetCurrentValue()));
$oValue->AddSubBlock(InputUIBlockFactory::MakeForHidden("",$this->oField->GetCurrentValue(), $this->oField->GetGlobalId()));
}
else
{
$oText = new TextArea("",$this->oField->GetCurrentValue(),$this->oField->GetGlobalId(),40,8);
$oText->AddCSSClasses(['ibo-input-field-wrapper', 'ibo-input']);
$oValue->AddSubBlock($oText);
// Some additional stuff if we are displaying it with a rich editor
if ($bRichEditor)
{