1

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

1 Answer 1

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
1
  • But how it knows which url to call? Commented Jun 29, 2020 at 17:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.