AddSubBlock(InputUIBlockFactory::MakeForHidden("{$this->sFormPrefix}{$this->iInputId}", '', "{$this->sFormPrefix}{$this->iInputId}")); $oToolbar = ToolbarUIBlockFactory::MakeStandard(null, ['ibo-datatable--selection-validation-buttons-toolbar']); $this->AddSubBlock($oToolbar); $oRemoveButton = ButtonUIBlockFactory::MakeForSecondaryAction(Dict::S('UI:RemoveLinkedObjectsOf_Class'), null, null, false, "{$this->sLinkedSetId}_btnRemove"); $oRemoveButton->SetOnClickJsCode("oWidget{$this->iInputId}.RemoveSelected();"); $oToolbar->AddSubBlock($oRemoveButton); $oAddButton = ButtonUIBlockFactory::MakeForSecondaryAction(Dict::Format('UI:AddLinkedObjectsOf_Class', MetaModel::GetName($this->sRemoteClass)), null, null, false, "{$this->sLinkedSetId}_btnAdd"); $oAddButton->SetOnClickJsCode("oWidget{$this->iInputId}.AddObjects();"); $oToolbar->AddSubBlock($oAddButton); // To prevent adding forms inside the main form $oDeferredBlock = new UIContentBlock("dlg_{$this->sLinkedSetId}", ['ibo-block-indirect-links--edit--dialog']); $this->AddDeferredBlock($oDeferredBlock); } }