I am using ui-component form edit and would like to add custom button "customButton" with all post data. However, it doesn't post any data except form key.
My code
$data = [
'label' => __('Print Address'),
'class' => 'save',
'data_attribute' => [
'url' => $this->urlBuilder->getUrl('*/*/printAddress', ['id' => $this->getRequest->getParam('id')]);
],
'sort_order' => 80,
];
asked Mar 10, 2019 at 8:03
the light
7381 gold badge5 silver badges15 bronze badges
1 Answer 1
Check CMS module as an example. You need to pass following params for submit form.
vendor/magento/module-cms/Block/Adminhtml/Page/Edit/SaveButton.php
'data_attribute' => [
'mage-init' => [
'buttonAdapter' => [
'actions' => [
[
'targetName' => 'cms_page_form.cms_page_form',
'actionName' => 'save',
'params' => [
false
]
]
]
]
]
],
answered Mar 10, 2019 at 8:20
Sohel Rana
36.2k3 gold badges74 silver badges94 bronze badges
-
But how it knows which url to call?Rafael Fagundes– Rafael Fagundes2020年06月29日 17:13:43 +00:00Commented Jun 29, 2020 at 17:13
Explore related questions
See similar questions with these tags.
default