0

I have created button on UI form:

<settings>
    <buttons>
        <button name="save">
            <url path="*/*/save"/>
            <class>save</class>
            <label translate="true">Save</label>
        </button>
        <button name="back">
            <url path="*/*/"/>
            <class>back</class>
            <label translate="true">Back</label>
        </button>
        <button name="send_mail" class="Vendor\ModuleName\Block\Adminhtml\Edit\Button\SendMail"/>
    </buttons>
    <namespace>ordercombine_index_edit</namespace>

    <dataScope>data</dataScope>
    <deps>
        <dep>ordercombine_index_edit.ordercombine_index_edit_data_source</dep>
    </deps>
</settings>

Button Data

 public function getButtonData()
{
    $data = [];
    if ($this->canshow()) {
        $data = [
            'label' => __('Send Mail'),
            'class' => 'save',
            'on_click' => sprintf("location.href = '%s';", $this->getButtonUrl()),

            'sort_order' => 80,
        ];
    }
    return $data;
}

But I can't get all post params when going to action Sendmail. Also, that button can't validate. Any help will be accept.

Your Answer

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

Browse other questions tagged or ask your own question.