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,
        ];

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.