Form container can't set child form / create form blockHow to change admin login template in Magento 1.5 or 1.6Exclude a specific categoryMagento Adminhtml createblock() Form 'Mage_Core_Exception' Ivalid Block TypeFatal error: Call to a member function setData() on a non-objectFresh install, no plug ins, fatal error on category management pageError when creating an Edit Block: Fatal error: Call to a member function setData()Why does my view page not load in Admin Panel?How to Display the Product Thumbnail Image in Admin FormForm is not displayed on panel admin Magento 2Getting error “Call to a member function setTitle()” after install extension

What is the term when voters “dishonestly” choose something that they do not want to choose?

What is the English word for a graduation award?

What does Jesus mean regarding "Raca," and "you fool?" - is he contrasting them?

Should I use acronyms in dialogues before telling the readers what it stands for in fiction?

How to get the n-th line after a grepped one?

Print a physical multiplication table

Can a medieval gyroplane be built?

Is it possible to stack the damage done by the Absorb Elements spell?

PTIJ What is the inyan of the Konami code in Uncle Moishy's song?

Pronounciation of the combination "st" in spanish accents

Optimising a list searching algorithm

What can I do if I am asked to learn different programming languages very frequently?

gerund and noun applications

Help rendering a complicated sum/product formula

Describing a chess game in a novel

Is it true that good novels will automatically sell themselves on Amazon (and so on) and there is no need for one to waste time promoting?

Deletion of copy-ctor & copy-assignment - public, private or protected?

Can a wizard cast a spell during their first turn of combat if they initiated combat by releasing a readied spell?

I got the following comment from a reputed math journal. What does it mean?

Relation between independence and correlation of uniform random variables

Unfrosted light bulb

Probably overheated black color SMD pads

In Aliens, how many people were on LV-426 before the Marines arrived​?

Writing in a Christian voice



Form container can't set child form / create form block


How to change admin login template in Magento 1.5 or 1.6Exclude a specific categoryMagento Adminhtml createblock() Form 'Mage_Core_Exception' Ivalid Block TypeFatal error: Call to a member function setData() on a non-objectFresh install, no plug ins, fatal error on category management pageError when creating an Edit Block: Fatal error: Call to a member function setData()Why does my view page not load in Admin Panel?How to Display the Product Thumbnail Image in Admin FormForm is not displayed on panel admin Magento 2Getting error “Call to a member function setTitle()” after install extension













1















My goal is to have a form into a form container. When I call directly my form in my controller, it works, but when I call the container, I have this issue :




Fatal error: Call to a member function setData() on boolean in app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php on line 144




The code line is :



public function getFormHtml() 
$this->getChild('form')->setData('action', $this->getSaveUrl());
return $this->getChildHtml('form');



And this refers to another line :



protected function _prepareLayout() 
if ($this->_blockGroup && $this->_controller && $this->_mode)
$this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup
. '/'
. $this->_controller
. '_'
. $this->_mode
. '_form'
)
);

return parent::_prepareLayout();



I've tried to tweak values of _blockGroup, _controller and _mode, but nothing works ...



My form container class :



class Cheek_Portraits_Block_Edit extends Mage_Adminhtml_Block_Widget_Form_Container

public function __construct()

$helper = Mage::helper('portraits');
$this->_blockGroup = 'portraits';
$this->_controller = 'page';
$this->_mode = 'edit';

if($this->getRequest()->getParam('id'))

$this->_headerText = $helper->__('Edit')." portrait";

else

$this->_headerText = $helper->__('New')." portrait";

parent::__construct();




Here my folders and files :





I also tried like this :












share|improve this question




























    1















    My goal is to have a form into a form container. When I call directly my form in my controller, it works, but when I call the container, I have this issue :




    Fatal error: Call to a member function setData() on boolean in app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php on line 144




    The code line is :



    public function getFormHtml() 
    $this->getChild('form')->setData('action', $this->getSaveUrl());
    return $this->getChildHtml('form');



    And this refers to another line :



    protected function _prepareLayout() 
    if ($this->_blockGroup && $this->_controller && $this->_mode)
    $this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup
    . '/'
    . $this->_controller
    . '_'
    . $this->_mode
    . '_form'
    )
    );

    return parent::_prepareLayout();



    I've tried to tweak values of _blockGroup, _controller and _mode, but nothing works ...



    My form container class :



    class Cheek_Portraits_Block_Edit extends Mage_Adminhtml_Block_Widget_Form_Container

    public function __construct()

    $helper = Mage::helper('portraits');
    $this->_blockGroup = 'portraits';
    $this->_controller = 'page';
    $this->_mode = 'edit';

    if($this->getRequest()->getParam('id'))

    $this->_headerText = $helper->__('Edit')." portrait";

    else

    $this->_headerText = $helper->__('New')." portrait";

    parent::__construct();




    Here my folders and files :





    I also tried like this :












    share|improve this question


























      1












      1








      1








      My goal is to have a form into a form container. When I call directly my form in my controller, it works, but when I call the container, I have this issue :




      Fatal error: Call to a member function setData() on boolean in app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php on line 144




      The code line is :



      public function getFormHtml() 
      $this->getChild('form')->setData('action', $this->getSaveUrl());
      return $this->getChildHtml('form');



      And this refers to another line :



      protected function _prepareLayout() 
      if ($this->_blockGroup && $this->_controller && $this->_mode)
      $this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup
      . '/'
      . $this->_controller
      . '_'
      . $this->_mode
      . '_form'
      )
      );

      return parent::_prepareLayout();



      I've tried to tweak values of _blockGroup, _controller and _mode, but nothing works ...



      My form container class :



      class Cheek_Portraits_Block_Edit extends Mage_Adminhtml_Block_Widget_Form_Container

      public function __construct()

      $helper = Mage::helper('portraits');
      $this->_blockGroup = 'portraits';
      $this->_controller = 'page';
      $this->_mode = 'edit';

      if($this->getRequest()->getParam('id'))

      $this->_headerText = $helper->__('Edit')." portrait";

      else

      $this->_headerText = $helper->__('New')." portrait";

      parent::__construct();




      Here my folders and files :





      I also tried like this :












      share|improve this question
















      My goal is to have a form into a form container. When I call directly my form in my controller, it works, but when I call the container, I have this issue :




      Fatal error: Call to a member function setData() on boolean in app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php on line 144




      The code line is :



      public function getFormHtml() 
      $this->getChild('form')->setData('action', $this->getSaveUrl());
      return $this->getChildHtml('form');



      And this refers to another line :



      protected function _prepareLayout() 
      if ($this->_blockGroup && $this->_controller && $this->_mode)
      $this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup
      . '/'
      . $this->_controller
      . '_'
      . $this->_mode
      . '_form'
      )
      );

      return parent::_prepareLayout();



      I've tried to tweak values of _blockGroup, _controller and _mode, but nothing works ...



      My form container class :



      class Cheek_Portraits_Block_Edit extends Mage_Adminhtml_Block_Widget_Form_Container

      public function __construct()

      $helper = Mage::helper('portraits');
      $this->_blockGroup = 'portraits';
      $this->_controller = 'page';
      $this->_mode = 'edit';

      if($this->getRequest()->getParam('id'))

      $this->_headerText = $helper->__('Edit')." portrait";

      else

      $this->_headerText = $helper->__('New')." portrait";

      parent::__construct();




      Here my folders and files :





      I also tried like this :









      magento-1.9 adminhtml forms






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 30 mins ago









      Teja Bhagavan Kollepara

      3,00641949




      3,00641949










      asked Jan 8 at 13:53









      EzwanEzwan

      62




      62




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Check if you really created the the Form.php file from Yourmodule/Yournamespace/Block/Adminhtml/Page/Edit/Form.php



          please make sure you have this method inside:



           protected function _prepareForm()

          $form = new Varien_Data_Form(
          [
          'id' => 'edit_form',
          'action' => $this->getUrl(
          '*/*/save',
          [
          'id' => $this->getRequest()->getParam('id')
          ]
          ),
          'method' => 'post',
          'enctype' => 'multipart/form-data'
          ]
          );
          $form->setUseContainer(true);
          $this->setForm($form);
          return parent::_prepareForm();



          For me missing that file caused this error.






          share|improve this answer






















            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
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f257138%2fform-container-cant-set-child-form-create-form-block%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














            Check if you really created the the Form.php file from Yourmodule/Yournamespace/Block/Adminhtml/Page/Edit/Form.php



            please make sure you have this method inside:



             protected function _prepareForm()

            $form = new Varien_Data_Form(
            [
            'id' => 'edit_form',
            'action' => $this->getUrl(
            '*/*/save',
            [
            'id' => $this->getRequest()->getParam('id')
            ]
            ),
            'method' => 'post',
            'enctype' => 'multipart/form-data'
            ]
            );
            $form->setUseContainer(true);
            $this->setForm($form);
            return parent::_prepareForm();



            For me missing that file caused this error.






            share|improve this answer



























              0














              Check if you really created the the Form.php file from Yourmodule/Yournamespace/Block/Adminhtml/Page/Edit/Form.php



              please make sure you have this method inside:



               protected function _prepareForm()

              $form = new Varien_Data_Form(
              [
              'id' => 'edit_form',
              'action' => $this->getUrl(
              '*/*/save',
              [
              'id' => $this->getRequest()->getParam('id')
              ]
              ),
              'method' => 'post',
              'enctype' => 'multipart/form-data'
              ]
              );
              $form->setUseContainer(true);
              $this->setForm($form);
              return parent::_prepareForm();



              For me missing that file caused this error.






              share|improve this answer

























                0












                0








                0







                Check if you really created the the Form.php file from Yourmodule/Yournamespace/Block/Adminhtml/Page/Edit/Form.php



                please make sure you have this method inside:



                 protected function _prepareForm()

                $form = new Varien_Data_Form(
                [
                'id' => 'edit_form',
                'action' => $this->getUrl(
                '*/*/save',
                [
                'id' => $this->getRequest()->getParam('id')
                ]
                ),
                'method' => 'post',
                'enctype' => 'multipart/form-data'
                ]
                );
                $form->setUseContainer(true);
                $this->setForm($form);
                return parent::_prepareForm();



                For me missing that file caused this error.






                share|improve this answer













                Check if you really created the the Form.php file from Yourmodule/Yournamespace/Block/Adminhtml/Page/Edit/Form.php



                please make sure you have this method inside:



                 protected function _prepareForm()

                $form = new Varien_Data_Form(
                [
                'id' => 'edit_form',
                'action' => $this->getUrl(
                '*/*/save',
                [
                'id' => $this->getRequest()->getParam('id')
                ]
                ),
                'method' => 'post',
                'enctype' => 'multipart/form-data'
                ]
                );
                $form->setUseContainer(true);
                $this->setForm($form);
                return parent::_prepareForm();



                For me missing that file caused this error.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 19 at 8:46









                Attila NaghiAttila Naghi

                1,54722043




                1,54722043



























                    draft saved

                    draft discarded
















































                    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%2f257138%2fform-container-cant-set-child-form-create-form-block%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

                    Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                    Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

                    Aasi (pallopeli) Navigointivalikko