Trying to create a custom module to upload .xls
file to the magento database. This is the error I get after creating the Edit
block for the dashboard:
Fatal error: Call to a member function setData() on boolean in /opt/lampp/htdocs/magento/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php on line 141
This is my Mymodule/Wine/Block/Adminhtml/Wine/Edit.php
<?php
class Mymodule_Wine_Block_Adminhtml_Wine_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
public function __construct()
{
parent::__construct();
$this->_objectId = 'id';
$this->_blockGroup = 'wine';
$this->_controller = 'adminhtml_wine';
$this->_updateButton('save', 'label', Mage::helper('wine')->__('Save Changes'));
$this->_updateButton('delete', 'label', Mage::helper('wine')->__('Delete Item'));
}
public function getHeaderText()
{
if (Mage::registry('wine_data') && Mage::registry('wine_data')->getId()) {
return Mage::helper('wine')->__('Edit Item \'%s\'', $this->htmlEscape(Mage::registry('wine_data')->getTitle()));
} else {
return Mage::helper('wine')->__('Upload .xls file');
}
}
}
And this is the part of config.xml
which corresponds to blocks:
<blocks>
<wine>
<class>Mymodule_Wine_Block</class>
</wine>
</blocks>