0

I made a Magento Admin form before and it was ok. But with help of this tutorial, I added tabs to it. But in HTML output, I have two form tag. one of the has the content of the form and form key and the other just has the form key.

tow headers for one form

The problem is company_Vendor_Block_Adminhtml_Vendor_Edit_Form._prepareForm() is run two times. So it makes two form and I think, it runs two times because of this line in vendorController.EditAction()

$this->_addContent($this->getLayout()->createBlock('vendor/adminhtml_vendor_edit'))
->_addLeft($this->getLayout()
 ->createBlock('vendor/adminhtml_vendor_edit_tabs'));

when I just have createBlock('vendor/adminhtml_vendor_edit') this is run only one-time but when I add the tab to left it is run two times. How Can I Solve It?

NOTE: My code is Exactly the same as the tutorial.

Priyank
7,7627 gold badges39 silver badges70 bronze badges
asked Jul 15, 2018 at 1:58
1
  • Welcome to SE. Pls specify your magento version. Commented Jul 15, 2018 at 3:14

1 Answer 1

0

I found the solution. The problem was about an extra(useless) XML layout file. So renderLayout() make an extra form.ithe problem can be solved by removing XML file from layout or just convert

 $this->_addContent($this->getLayout()->createBlock('vendor/adminhtml_vendor_edit'))->_addLeft($this->getLayout()->createBlock('vendor/adminhtml_vendor_edit_tabs'));

TO

$this->_addLeft($this->getLayout()->createBlock('vendor/adminhtml_vendor_edit_tabs'));
answered Jul 15, 2018 at 4:21

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.