Save Button Redirecting to Same Admin Form in Magento 2 Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?uiComponent Form Save Button Not workingMagento 2 : Problem while adding custom button order view page?Magento 2: How to override newsletter Subscriber modelWhy Getting categories and names on product view page Magento 2 fails?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formMagento offline custom Payment method with drop down listMagento 2 Create dynamic array From different Model Collection to use in multi select in gridMagento 2.2.5: Overriding Admin Controller sales/orderI have created one field using product form field for my price i want save my field value at product creation time from backend magento2Magento 2.3 Can't view module's front end page output?

What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?

ArcGIS Pro Python arcpy.CreatePersonalGDB_management

Is there a kind of relay that only consumes power when switching?

Why weren't discrete x86 CPUs ever used in game hardware?

Question about debouncing - delay of state change

What is the difference between globalisation and imperialism?

If Windows 7 doesn't support WSL, then what does Linux subsystem option mean?

How much damage would a cupful of neutron star matter do to the Earth?

Generate an RGB colour grid

Amount of permutations on an NxNxN Rubik's Cube

Why should I vote and accept answers?

AppleTVs create a chatty alternate WiFi network

Is a ledger board required if the side of my house is wood?

Why does the remaining Rebel fleet at the end of Rogue One seem dramatically larger than the one in A New Hope?

Maximum summed subsequences with non-adjacent items

What initially awakened the Balrog?

What would you call this weird metallic apparatus that allows you to lift people?

What order were files/directories outputted in dir?

What are the out-of-universe reasons for the references to Toby Maguire-era Spider-Man in Into the Spider-Verse?

How would a mousetrap for use in space work?

Effects on objects due to a brief relocation of massive amounts of mass

What do you call the main part of a joke?

An adverb for when you're not exaggerating

How do I use the new nonlinear finite element in Mathematica 12 for this equation?



Save Button Redirecting to Same Admin Form in Magento 2



Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?uiComponent Form Save Button Not workingMagento 2 : Problem while adding custom button order view page?Magento 2: How to override newsletter Subscriber modelWhy Getting categories and names on product view page Magento 2 fails?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formMagento offline custom Payment method with drop down listMagento 2 Create dynamic array From different Model Collection to use in multi select in gridMagento 2.2.5: Overriding Admin Controller sales/orderI have created one field using product form field for my price i want save my field value at product creation time from backend magento2Magento 2.3 Can't view module's front end page output?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I am working on a custom module in magneto 2. i am creating an admin form using UI Component, when i click on save button Page redirects to its self




VendorModuleBlockAdminhtmlProductSlidersEditSaveButton




use MagentoFrameworkViewElementUiComponentControl

ButtonProviderInterface;

/**
* Class SaveButton
* @package MagentoCustomerBlockAdminhtmlEdit
*/
class SaveButton extends GenericButton implements ButtonProviderInterface

/**
* @return array
*/
public function getButtonData()

return [
'label' => __('Save'),
'class' => 'save primary',
'data_attribute' => [
'mage-init' => ['button' => ['event' => 'save']],
'form-role' => 'save',
],
'sort_order' => 90,
];




i have make buttons using Block here is my Edit.php Class




VendorModuleBlockAdminhtmlProductSlidersEdit




class Edit extends MagentoBackendBlockWidgetFormContainer


protected $_coreRegistry = null;


public function __construct(
MagentoBackendBlockWidgetContext $context,
MagentoFrameworkRegistry $registry,
array $data = []
)
$this->_coreRegistry = $registry;
parent::__construct($context, $data);



protected function _construct()

$this->_objectId = 'slider_id';
$this->_blockGroup = 'FME_ProductSliders';
$this->_controller = 'adminhtml_productsliders';
parent::_construct();

if ($this->_isAllowedAction('FME_ProductSliders::productsliders'))
$this->buttonList->update('save', 'label', __('Save'));
$this->buttonList->add(
'saveandcontinue',
[
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form'],
],
]
],
-100
);
else
$this->buttonList->remove('save');


if ($this->_isAllowedAction('FME_ProductSliders::productsliders'))
$this->buttonList->update('delete', 'label', __('Delete'));
else
$this->buttonList->remove('delete');





/**
* Retrieve text for header element depending on loaded page
*
* @return string
*/
public function getHeaderText()


if ($this->_coreRegistry->registry('fme_productsliders')->getId())
return __(
"Edit Sliders '%1'",
$this->escapeHtml($this->_coreRegistry->registry('fme_productsliders')->getTitle())
);
else
return __('New Sliders');



/**
* Check permission for passed action
*
* @param string $resourceId
* @return bool
*/
public function _isAllowedAction($resourceId)

return $this->_authorization->isAllowed($resourceId);


/**
* Getter of url for "Save and Continue" button
* tab_id will be replaced by desired by JS later
*
* @return string
*/


public function _getSaveAndContinueUrl()


return $this->getUrl(
'fme_productsliders/*/save',
['_current' => true,
'back' => 'edit',
'active_tab' => 'tab_id']
);



/**
* Prepare layout
*
* @return MagentoFrameworkViewElementAbstractBlock
*/
protected function _prepareLayout()

$this->_formScripts[] = "
function toggleEditor()
if (tinyMCE.getInstanceById('overview') == null)
tinyMCE.execCommand('mceAddControl', false, 'overview');
else
tinyMCE.execCommand('mceRemoveControl', false, 'overview');

;
";
return parent::_prepareLayout();




Here is my save.php controller




VendorModuleControllerAdminhtmlModule;




class Save extends MagentoBackendAppAction

var $sliderFactory;


public function __construct(
MagentoBackendAppActionContext $context,
FMEProductSlidersModelProductSlidersFactory $sliderFactory
)
parent::__construct($context);
$this->sliderFactory = $sliderFactory;



public function execute()

$data = $this->getRequest()->getPostValue();
if (!$data)

$this->_redirect('fme_productsliders/productsliders/edit');
return;

try
$rowData = $this->sliderFactory->create();
$rowData->setData($data);
if (isset($data['slider_id']))
$rowData->setEntityId($data['slider_id']);

$rowData->save();
$this->messageManager->addSuccess(__('Row data has been successfully saved.'));
catch (Exception $e)
$this->messageManager->addError(__($e->getMessage()));

$this->_redirect('fme_productsliders/productsliders/index');


/**
* @return bool
*/
protected function _isAllowed()

return $this->_authorization->isAllowed('FME_ProductSliders::save');




i Need a Help if anyone can??










share|improve this question









New contributor




Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


























    2















    I am working on a custom module in magneto 2. i am creating an admin form using UI Component, when i click on save button Page redirects to its self




    VendorModuleBlockAdminhtmlProductSlidersEditSaveButton




    use MagentoFrameworkViewElementUiComponentControl

    ButtonProviderInterface;

    /**
    * Class SaveButton
    * @package MagentoCustomerBlockAdminhtmlEdit
    */
    class SaveButton extends GenericButton implements ButtonProviderInterface

    /**
    * @return array
    */
    public function getButtonData()

    return [
    'label' => __('Save'),
    'class' => 'save primary',
    'data_attribute' => [
    'mage-init' => ['button' => ['event' => 'save']],
    'form-role' => 'save',
    ],
    'sort_order' => 90,
    ];




    i have make buttons using Block here is my Edit.php Class




    VendorModuleBlockAdminhtmlProductSlidersEdit




    class Edit extends MagentoBackendBlockWidgetFormContainer


    protected $_coreRegistry = null;


    public function __construct(
    MagentoBackendBlockWidgetContext $context,
    MagentoFrameworkRegistry $registry,
    array $data = []
    )
    $this->_coreRegistry = $registry;
    parent::__construct($context, $data);



    protected function _construct()

    $this->_objectId = 'slider_id';
    $this->_blockGroup = 'FME_ProductSliders';
    $this->_controller = 'adminhtml_productsliders';
    parent::_construct();

    if ($this->_isAllowedAction('FME_ProductSliders::productsliders'))
    $this->buttonList->update('save', 'label', __('Save'));
    $this->buttonList->add(
    'saveandcontinue',
    [
    'label' => __('Save and Continue Edit'),
    'class' => 'save',
    'data_attribute' => [
    'mage-init' => [
    'button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form'],
    ],
    ]
    ],
    -100
    );
    else
    $this->buttonList->remove('save');


    if ($this->_isAllowedAction('FME_ProductSliders::productsliders'))
    $this->buttonList->update('delete', 'label', __('Delete'));
    else
    $this->buttonList->remove('delete');





    /**
    * Retrieve text for header element depending on loaded page
    *
    * @return string
    */
    public function getHeaderText()


    if ($this->_coreRegistry->registry('fme_productsliders')->getId())
    return __(
    "Edit Sliders '%1'",
    $this->escapeHtml($this->_coreRegistry->registry('fme_productsliders')->getTitle())
    );
    else
    return __('New Sliders');



    /**
    * Check permission for passed action
    *
    * @param string $resourceId
    * @return bool
    */
    public function _isAllowedAction($resourceId)

    return $this->_authorization->isAllowed($resourceId);


    /**
    * Getter of url for "Save and Continue" button
    * tab_id will be replaced by desired by JS later
    *
    * @return string
    */


    public function _getSaveAndContinueUrl()


    return $this->getUrl(
    'fme_productsliders/*/save',
    ['_current' => true,
    'back' => 'edit',
    'active_tab' => 'tab_id']
    );



    /**
    * Prepare layout
    *
    * @return MagentoFrameworkViewElementAbstractBlock
    */
    protected function _prepareLayout()

    $this->_formScripts[] = "
    function toggleEditor()
    if (tinyMCE.getInstanceById('overview') == null)
    tinyMCE.execCommand('mceAddControl', false, 'overview');
    else
    tinyMCE.execCommand('mceRemoveControl', false, 'overview');

    ;
    ";
    return parent::_prepareLayout();




    Here is my save.php controller




    VendorModuleControllerAdminhtmlModule;




    class Save extends MagentoBackendAppAction

    var $sliderFactory;


    public function __construct(
    MagentoBackendAppActionContext $context,
    FMEProductSlidersModelProductSlidersFactory $sliderFactory
    )
    parent::__construct($context);
    $this->sliderFactory = $sliderFactory;



    public function execute()

    $data = $this->getRequest()->getPostValue();
    if (!$data)

    $this->_redirect('fme_productsliders/productsliders/edit');
    return;

    try
    $rowData = $this->sliderFactory->create();
    $rowData->setData($data);
    if (isset($data['slider_id']))
    $rowData->setEntityId($data['slider_id']);

    $rowData->save();
    $this->messageManager->addSuccess(__('Row data has been successfully saved.'));
    catch (Exception $e)
    $this->messageManager->addError(__($e->getMessage()));

    $this->_redirect('fme_productsliders/productsliders/index');


    /**
    * @return bool
    */
    protected function _isAllowed()

    return $this->_authorization->isAllowed('FME_ProductSliders::save');




    i Need a Help if anyone can??










    share|improve this question









    New contributor




    Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      2












      2








      2








      I am working on a custom module in magneto 2. i am creating an admin form using UI Component, when i click on save button Page redirects to its self




      VendorModuleBlockAdminhtmlProductSlidersEditSaveButton




      use MagentoFrameworkViewElementUiComponentControl

      ButtonProviderInterface;

      /**
      * Class SaveButton
      * @package MagentoCustomerBlockAdminhtmlEdit
      */
      class SaveButton extends GenericButton implements ButtonProviderInterface

      /**
      * @return array
      */
      public function getButtonData()

      return [
      'label' => __('Save'),
      'class' => 'save primary',
      'data_attribute' => [
      'mage-init' => ['button' => ['event' => 'save']],
      'form-role' => 'save',
      ],
      'sort_order' => 90,
      ];




      i have make buttons using Block here is my Edit.php Class




      VendorModuleBlockAdminhtmlProductSlidersEdit




      class Edit extends MagentoBackendBlockWidgetFormContainer


      protected $_coreRegistry = null;


      public function __construct(
      MagentoBackendBlockWidgetContext $context,
      MagentoFrameworkRegistry $registry,
      array $data = []
      )
      $this->_coreRegistry = $registry;
      parent::__construct($context, $data);



      protected function _construct()

      $this->_objectId = 'slider_id';
      $this->_blockGroup = 'FME_ProductSliders';
      $this->_controller = 'adminhtml_productsliders';
      parent::_construct();

      if ($this->_isAllowedAction('FME_ProductSliders::productsliders'))
      $this->buttonList->update('save', 'label', __('Save'));
      $this->buttonList->add(
      'saveandcontinue',
      [
      'label' => __('Save and Continue Edit'),
      'class' => 'save',
      'data_attribute' => [
      'mage-init' => [
      'button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form'],
      ],
      ]
      ],
      -100
      );
      else
      $this->buttonList->remove('save');


      if ($this->_isAllowedAction('FME_ProductSliders::productsliders'))
      $this->buttonList->update('delete', 'label', __('Delete'));
      else
      $this->buttonList->remove('delete');





      /**
      * Retrieve text for header element depending on loaded page
      *
      * @return string
      */
      public function getHeaderText()


      if ($this->_coreRegistry->registry('fme_productsliders')->getId())
      return __(
      "Edit Sliders '%1'",
      $this->escapeHtml($this->_coreRegistry->registry('fme_productsliders')->getTitle())
      );
      else
      return __('New Sliders');



      /**
      * Check permission for passed action
      *
      * @param string $resourceId
      * @return bool
      */
      public function _isAllowedAction($resourceId)

      return $this->_authorization->isAllowed($resourceId);


      /**
      * Getter of url for "Save and Continue" button
      * tab_id will be replaced by desired by JS later
      *
      * @return string
      */


      public function _getSaveAndContinueUrl()


      return $this->getUrl(
      'fme_productsliders/*/save',
      ['_current' => true,
      'back' => 'edit',
      'active_tab' => 'tab_id']
      );



      /**
      * Prepare layout
      *
      * @return MagentoFrameworkViewElementAbstractBlock
      */
      protected function _prepareLayout()

      $this->_formScripts[] = "
      function toggleEditor()
      if (tinyMCE.getInstanceById('overview') == null)
      tinyMCE.execCommand('mceAddControl', false, 'overview');
      else
      tinyMCE.execCommand('mceRemoveControl', false, 'overview');

      ;
      ";
      return parent::_prepareLayout();




      Here is my save.php controller




      VendorModuleControllerAdminhtmlModule;




      class Save extends MagentoBackendAppAction

      var $sliderFactory;


      public function __construct(
      MagentoBackendAppActionContext $context,
      FMEProductSlidersModelProductSlidersFactory $sliderFactory
      )
      parent::__construct($context);
      $this->sliderFactory = $sliderFactory;



      public function execute()

      $data = $this->getRequest()->getPostValue();
      if (!$data)

      $this->_redirect('fme_productsliders/productsliders/edit');
      return;

      try
      $rowData = $this->sliderFactory->create();
      $rowData->setData($data);
      if (isset($data['slider_id']))
      $rowData->setEntityId($data['slider_id']);

      $rowData->save();
      $this->messageManager->addSuccess(__('Row data has been successfully saved.'));
      catch (Exception $e)
      $this->messageManager->addError(__($e->getMessage()));

      $this->_redirect('fme_productsliders/productsliders/index');


      /**
      * @return bool
      */
      protected function _isAllowed()

      return $this->_authorization->isAllowed('FME_ProductSliders::save');




      i Need a Help if anyone can??










      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am working on a custom module in magneto 2. i am creating an admin form using UI Component, when i click on save button Page redirects to its self




      VendorModuleBlockAdminhtmlProductSlidersEditSaveButton




      use MagentoFrameworkViewElementUiComponentControl

      ButtonProviderInterface;

      /**
      * Class SaveButton
      * @package MagentoCustomerBlockAdminhtmlEdit
      */
      class SaveButton extends GenericButton implements ButtonProviderInterface

      /**
      * @return array
      */
      public function getButtonData()

      return [
      'label' => __('Save'),
      'class' => 'save primary',
      'data_attribute' => [
      'mage-init' => ['button' => ['event' => 'save']],
      'form-role' => 'save',
      ],
      'sort_order' => 90,
      ];




      i have make buttons using Block here is my Edit.php Class




      VendorModuleBlockAdminhtmlProductSlidersEdit




      class Edit extends MagentoBackendBlockWidgetFormContainer


      protected $_coreRegistry = null;


      public function __construct(
      MagentoBackendBlockWidgetContext $context,
      MagentoFrameworkRegistry $registry,
      array $data = []
      )
      $this->_coreRegistry = $registry;
      parent::__construct($context, $data);



      protected function _construct()

      $this->_objectId = 'slider_id';
      $this->_blockGroup = 'FME_ProductSliders';
      $this->_controller = 'adminhtml_productsliders';
      parent::_construct();

      if ($this->_isAllowedAction('FME_ProductSliders::productsliders'))
      $this->buttonList->update('save', 'label', __('Save'));
      $this->buttonList->add(
      'saveandcontinue',
      [
      'label' => __('Save and Continue Edit'),
      'class' => 'save',
      'data_attribute' => [
      'mage-init' => [
      'button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form'],
      ],
      ]
      ],
      -100
      );
      else
      $this->buttonList->remove('save');


      if ($this->_isAllowedAction('FME_ProductSliders::productsliders'))
      $this->buttonList->update('delete', 'label', __('Delete'));
      else
      $this->buttonList->remove('delete');





      /**
      * Retrieve text for header element depending on loaded page
      *
      * @return string
      */
      public function getHeaderText()


      if ($this->_coreRegistry->registry('fme_productsliders')->getId())
      return __(
      "Edit Sliders '%1'",
      $this->escapeHtml($this->_coreRegistry->registry('fme_productsliders')->getTitle())
      );
      else
      return __('New Sliders');



      /**
      * Check permission for passed action
      *
      * @param string $resourceId
      * @return bool
      */
      public function _isAllowedAction($resourceId)

      return $this->_authorization->isAllowed($resourceId);


      /**
      * Getter of url for "Save and Continue" button
      * tab_id will be replaced by desired by JS later
      *
      * @return string
      */


      public function _getSaveAndContinueUrl()


      return $this->getUrl(
      'fme_productsliders/*/save',
      ['_current' => true,
      'back' => 'edit',
      'active_tab' => 'tab_id']
      );



      /**
      * Prepare layout
      *
      * @return MagentoFrameworkViewElementAbstractBlock
      */
      protected function _prepareLayout()

      $this->_formScripts[] = "
      function toggleEditor()
      if (tinyMCE.getInstanceById('overview') == null)
      tinyMCE.execCommand('mceAddControl', false, 'overview');
      else
      tinyMCE.execCommand('mceRemoveControl', false, 'overview');

      ;
      ";
      return parent::_prepareLayout();




      Here is my save.php controller




      VendorModuleControllerAdminhtmlModule;




      class Save extends MagentoBackendAppAction

      var $sliderFactory;


      public function __construct(
      MagentoBackendAppActionContext $context,
      FMEProductSlidersModelProductSlidersFactory $sliderFactory
      )
      parent::__construct($context);
      $this->sliderFactory = $sliderFactory;



      public function execute()

      $data = $this->getRequest()->getPostValue();
      if (!$data)

      $this->_redirect('fme_productsliders/productsliders/edit');
      return;

      try
      $rowData = $this->sliderFactory->create();
      $rowData->setData($data);
      if (isset($data['slider_id']))
      $rowData->setEntityId($data['slider_id']);

      $rowData->save();
      $this->messageManager->addSuccess(__('Row data has been successfully saved.'));
      catch (Exception $e)
      $this->messageManager->addError(__($e->getMessage()));

      $this->_redirect('fme_productsliders/productsliders/index');


      /**
      * @return bool
      */
      protected function _isAllowed()

      return $this->_authorization->isAllowed('FME_ProductSliders::save');




      i Need a Help if anyone can??







      magento2 database magento2.3 php-7






      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited yesterday







      Waqar Ali













      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 days ago









      Waqar AliWaqar Ali

      114




      114




      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can try to set current to false



          public function _getSaveAndContinueUrl()


          return $this->getUrl(
          'fme_productsliders/*/save',
          ['_current' => false,
          'back' => 'edit',
          'active_tab' => 'tab_id']
          );



          Update: Add a return in execute method



          public function execute()

          $data = $this->getRequest()->getPostValue();
          if (!$data)

          $this->_redirect('fme_productsliders/productsliders/edit');
          return;

          try
          $rowData = $this->sliderFactory->create();
          $rowData->setData($data);
          if (isset($data['slider_id']))
          $rowData->setEntityId($data['slider_id']);

          $rowData->save();
          $this->messageManager->addSuccess(__('Row data has been successfully saved.'));
          catch (Exception $e)
          $this->messageManager->addError(__($e->getMessage()));

          return $this->_redirect('fme_productsliders/productsliders/index');






          share|improve this answer

























          • not working how can i check this method is called not not

            – Waqar Ali
            yesterday











          • @WaqarAli updated the answer please check

            – magefms
            yesterday











          • Thank you foyour help but i solved problem by adding <item name="save" xsi:type="array"> <item name="name" xsi:type="string">save</item> <item name="label" xsi:type="string" translate="true">save</item> <item name="class" xsi:type="string">primary</item> </item>

            – Waqar Ali
            yesterday






          • 1





            i got help from [magento.stackexchange.com/questions/139639/…

            – Waqar Ali
            yesterday











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270333%2fsave-button-redirecting-to-same-admin-form-in-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You can try to set current to false



          public function _getSaveAndContinueUrl()


          return $this->getUrl(
          'fme_productsliders/*/save',
          ['_current' => false,
          'back' => 'edit',
          'active_tab' => 'tab_id']
          );



          Update: Add a return in execute method



          public function execute()

          $data = $this->getRequest()->getPostValue();
          if (!$data)

          $this->_redirect('fme_productsliders/productsliders/edit');
          return;

          try
          $rowData = $this->sliderFactory->create();
          $rowData->setData($data);
          if (isset($data['slider_id']))
          $rowData->setEntityId($data['slider_id']);

          $rowData->save();
          $this->messageManager->addSuccess(__('Row data has been successfully saved.'));
          catch (Exception $e)
          $this->messageManager->addError(__($e->getMessage()));

          return $this->_redirect('fme_productsliders/productsliders/index');






          share|improve this answer

























          • not working how can i check this method is called not not

            – Waqar Ali
            yesterday











          • @WaqarAli updated the answer please check

            – magefms
            yesterday











          • Thank you foyour help but i solved problem by adding <item name="save" xsi:type="array"> <item name="name" xsi:type="string">save</item> <item name="label" xsi:type="string" translate="true">save</item> <item name="class" xsi:type="string">primary</item> </item>

            – Waqar Ali
            yesterday






          • 1





            i got help from [magento.stackexchange.com/questions/139639/…

            – Waqar Ali
            yesterday















          0














          You can try to set current to false



          public function _getSaveAndContinueUrl()


          return $this->getUrl(
          'fme_productsliders/*/save',
          ['_current' => false,
          'back' => 'edit',
          'active_tab' => 'tab_id']
          );



          Update: Add a return in execute method



          public function execute()

          $data = $this->getRequest()->getPostValue();
          if (!$data)

          $this->_redirect('fme_productsliders/productsliders/edit');
          return;

          try
          $rowData = $this->sliderFactory->create();
          $rowData->setData($data);
          if (isset($data['slider_id']))
          $rowData->setEntityId($data['slider_id']);

          $rowData->save();
          $this->messageManager->addSuccess(__('Row data has been successfully saved.'));
          catch (Exception $e)
          $this->messageManager->addError(__($e->getMessage()));

          return $this->_redirect('fme_productsliders/productsliders/index');






          share|improve this answer

























          • not working how can i check this method is called not not

            – Waqar Ali
            yesterday











          • @WaqarAli updated the answer please check

            – magefms
            yesterday











          • Thank you foyour help but i solved problem by adding <item name="save" xsi:type="array"> <item name="name" xsi:type="string">save</item> <item name="label" xsi:type="string" translate="true">save</item> <item name="class" xsi:type="string">primary</item> </item>

            – Waqar Ali
            yesterday






          • 1





            i got help from [magento.stackexchange.com/questions/139639/…

            – Waqar Ali
            yesterday













          0












          0








          0







          You can try to set current to false



          public function _getSaveAndContinueUrl()


          return $this->getUrl(
          'fme_productsliders/*/save',
          ['_current' => false,
          'back' => 'edit',
          'active_tab' => 'tab_id']
          );



          Update: Add a return in execute method



          public function execute()

          $data = $this->getRequest()->getPostValue();
          if (!$data)

          $this->_redirect('fme_productsliders/productsliders/edit');
          return;

          try
          $rowData = $this->sliderFactory->create();
          $rowData->setData($data);
          if (isset($data['slider_id']))
          $rowData->setEntityId($data['slider_id']);

          $rowData->save();
          $this->messageManager->addSuccess(__('Row data has been successfully saved.'));
          catch (Exception $e)
          $this->messageManager->addError(__($e->getMessage()));

          return $this->_redirect('fme_productsliders/productsliders/index');






          share|improve this answer















          You can try to set current to false



          public function _getSaveAndContinueUrl()


          return $this->getUrl(
          'fme_productsliders/*/save',
          ['_current' => false,
          'back' => 'edit',
          'active_tab' => 'tab_id']
          );



          Update: Add a return in execute method



          public function execute()

          $data = $this->getRequest()->getPostValue();
          if (!$data)

          $this->_redirect('fme_productsliders/productsliders/edit');
          return;

          try
          $rowData = $this->sliderFactory->create();
          $rowData->setData($data);
          if (isset($data['slider_id']))
          $rowData->setEntityId($data['slider_id']);

          $rowData->save();
          $this->messageManager->addSuccess(__('Row data has been successfully saved.'));
          catch (Exception $e)
          $this->messageManager->addError(__($e->getMessage()));

          return $this->_redirect('fme_productsliders/productsliders/index');







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday

























          answered 2 days ago









          magefmsmagefms

          2,7702528




          2,7702528












          • not working how can i check this method is called not not

            – Waqar Ali
            yesterday











          • @WaqarAli updated the answer please check

            – magefms
            yesterday











          • Thank you foyour help but i solved problem by adding <item name="save" xsi:type="array"> <item name="name" xsi:type="string">save</item> <item name="label" xsi:type="string" translate="true">save</item> <item name="class" xsi:type="string">primary</item> </item>

            – Waqar Ali
            yesterday






          • 1





            i got help from [magento.stackexchange.com/questions/139639/…

            – Waqar Ali
            yesterday

















          • not working how can i check this method is called not not

            – Waqar Ali
            yesterday











          • @WaqarAli updated the answer please check

            – magefms
            yesterday











          • Thank you foyour help but i solved problem by adding <item name="save" xsi:type="array"> <item name="name" xsi:type="string">save</item> <item name="label" xsi:type="string" translate="true">save</item> <item name="class" xsi:type="string">primary</item> </item>

            – Waqar Ali
            yesterday






          • 1





            i got help from [magento.stackexchange.com/questions/139639/…

            – Waqar Ali
            yesterday
















          not working how can i check this method is called not not

          – Waqar Ali
          yesterday





          not working how can i check this method is called not not

          – Waqar Ali
          yesterday













          @WaqarAli updated the answer please check

          – magefms
          yesterday





          @WaqarAli updated the answer please check

          – magefms
          yesterday













          Thank you foyour help but i solved problem by adding <item name="save" xsi:type="array"> <item name="name" xsi:type="string">save</item> <item name="label" xsi:type="string" translate="true">save</item> <item name="class" xsi:type="string">primary</item> </item>

          – Waqar Ali
          yesterday





          Thank you foyour help but i solved problem by adding <item name="save" xsi:type="array"> <item name="name" xsi:type="string">save</item> <item name="label" xsi:type="string" translate="true">save</item> <item name="class" xsi:type="string">primary</item> </item>

          – Waqar Ali
          yesterday




          1




          1





          i got help from [magento.stackexchange.com/questions/139639/…

          – Waqar Ali
          yesterday





          i got help from [magento.stackexchange.com/questions/139639/…

          – Waqar Ali
          yesterday










          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.












          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.











          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270333%2fsave-button-redirecting-to-same-admin-form-in-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?