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

                    Disable / Remove link to Product Items in Cart Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How can I limit products that can be bought / added to cart?Remove item from cartHide “Add to Cart” button if specific products are already in cart“Prettifying” the custom options in cart pageCreate link in cart sidebar to view all added items After limit reachedLink products together in checkout/cartHow to Get product from cart and add it againHide action-edit on cart page if simple productRemoving Cart items - ObserverRemove wishlist items when added to cart

                    Helsingin valtaus Sisällysluettelo Taustaa | Yleistä sotatoimista | Osapuolet | Taistelut Helsingin ympäristössä | Punaisten antautumissuunnitelma | Taistelujen kulku Helsingissä | Valtauksen jälkeen | Tappiot | Muistaminen | Kirjallisuutta | Lähteet | Aiheesta muualla | NavigointivalikkoTeoksen verkkoversioTeoksen verkkoversioGoogle BooksSisällissota Helsingissä päättyi tasan 95 vuotta sittenSaksalaisten ylivoima jyräsi punaisen HelsinginSuomalaiset kuvaavat sotien jälkiä kaupungeissa – katso kuvat ja tarinat tutuilta kulmiltaHelsingin valtaus 90 vuotta sittenSaksalaiset valtasivat HelsinginHyökkäys HelsinkiinHelsingin valtaus 12.–13.4. 1918Saksalaiset käyttivät ihmiskilpiä Helsingin valtauksessa 1918Teoksen verkkoversioTeoksen verkkoversioSaksalaiset hyökkäävät Etelä-SuomeenTaistelut LeppävaarassaSotilaat ja taistelutLeppävaara 1918 huhtikuussa. KapinatarinaHelsingin taistelut 1918Saksalaisten voitonparaati HelsingissäHelsingin valtausta juhlittiinSaksalaisten Helsinki vuonna 1918Helsingin taistelussa kaatuneet valkokaartilaisetHelsinkiin haudatut taisteluissa kaatuneet punaiset12.4.1918 Helsingin valtauksessa saksalaiset apujoukot vapauttavat kaupunginVapaussodan muistomerkkejä Helsingissä ja pääkaupunkiseudullaCrescendo / Vuoden 1918 Kansalaissodan uhrien muistomerkkim

                    Adjektiivitarina Tarinan tekeminen | Esimerkki: ennen | Esimerkki: jälkeen | Navigointivalikko