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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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