<?php
namespace AppFactory\Basic\Block\Adminhtml\Slides;
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
class SaveButton implements ButtonProviderInterface
{
/**
* @return array
*/
public function getButtonData()
{
return [
'label' => __('Save Slide'),
'class' => 'save primary',
'on_click''data_attribute' => ''[
'mage-init' => ['button' => ['event' => 'save']],
'form-role' => 'save',
],
'sort_order' => 90,
];
}
}
My problem is when clicking the button it's not following the submit url, just /appfactory/slides/undefined
, im not sure where undefined came from and why it's not following the submit url.
Generate Save Button HTML
<button id="save" title="Save Slide" type="button" class="action- scalable save primary ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" onclick="location.href = 'http://appfactory.loc/';" data-form-role="save" data-ui-id="save-button" role="button" aria-disabled="false"><span class="ui-button-text">
<span>Save Slide</span>
</span></button>