diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 7c0387466..5c503ce54 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -2188,7 +2188,6 @@ EOF break; case 'ExtKey': - $sInputType = ''; // TODO /** @var \AttributeExternalKey $oAttDef */ $aEventsList[] = 'validate'; $aEventsList[] = 'change'; @@ -2451,6 +2450,16 @@ JS $oPage->add_dict_entry('UI:ValueMustBeChanged'); $oPage->add_dict_entry('UI:ValueInvalidFormat'); + // N°3750 refresh container data-input-type attribute if in an Ajax context + // indeed in such a case we're only returning the field value content and not the parent container, so we need to update it ! + if (WebPage::IsAjaxPage($oPage)) { + $sHTMLValue .= << +$("[data-input-id='$iId']").data("input-type", "$sInputType"); + +HTML; + } + //TODO 3.0 remove the data-attcode attribute (either because it's has been moved to .field_container in 2.7 or even better because the admin. console has been reworked) return "
{$sHTMLValue}
"; } diff --git a/sources/application/WebPage/WebPage.php b/sources/application/WebPage/WebPage.php index 97429f887..aea51689f 100644 --- a/sources/application/WebPage/WebPage.php +++ b/sources/application/WebPage/WebPage.php @@ -1492,4 +1492,8 @@ EOD return $this->sTemplateRelPath; } + public static function IsAjaxPage(WebPage $oPage) + { + return ($oPage instanceof AjaxPage); + } }