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
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
add a comment |
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
add a comment |
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
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
magento-1.9 adminhtml forms
edited 30 mins ago
Teja Bhagavan Kollepara
3,00641949
3,00641949
asked Jan 8 at 13:53
EzwanEzwan
62
62
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Feb 19 at 8:46
Attila NaghiAttila Naghi
1,54722043
1,54722043
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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