I want to pass a value/params via the save button of my ui adminform.
i tried this:
public function getButtonData()
{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$request = $objectManager->get('Magento\Framework\App\RequestInterface');
$id = $request->getParam('id');
return
[
'label' => __('Save'),
'class' => 'save primary',
'on_click' => '',
'sort_order' => 80,
'data_attribute' => [
'mage-init' => [
'Magento_Ui/js/form/button-adapter' => [
'actions' => [
[
'targetName' => 'thechateau_magenest_bookable_save',
'actionName' => 'save',
'params' => [
true,
['multidome_id' =>$id],
]
]
]
]
],
]
];
}
I can indeed see the values in the save button of the phtml page.
<button id="save" title="Save" type="button" class="action- scalable save primary" data-mage-init="{"Magento_Ui\/js\/form\/button-adapter":{"actions":[{"targetName":"thechateau_magenest_bookable_save","actionName":"save","params":[true,{"multidome_id":"1"}]}]}}" data-ui-id="save-button" >
<span>Save</span>
</button>
however when i try to retreive these values it comes up null.
$request = $this->_objectManager->create('Magento\Framework\App\RequestInterface');
$multiDome = $request->getParam('multidome_id');
I also tried to add it as part of the URL of the save button but it does not even show up on this:
public function getSaveUrl()
{
return $this->getUrl('*/*/save',['param'=>'value']);
}