Closed aishwaryacedcoss closed 9 years ago
@aishwaryacedcoss Use this instead:
$this->buttonList->update('save', 'label', __('Save Post'));
and while you are at it, change the way the save and continue button is added because you will get an error after fixing the issue above
$this->buttonList->add(
'save-and-continue',
[
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => [
'event' => 'saveAndContinueEdit',
'target' => '#edit_form'
]
]
]
],
-100
);
It is saying :- undefined property: Excercise\Weblog\Block\Adminhtml\Blogpost\Edit::$buttonList in /opt/lampp/htdocs/workspace/magento2/app/code/Excercise/Weblog/Block/Adminhtml/Blogpost/Edit.php on line 39";i:1;s:10863:"#0 /opt/lampp/htdocs/workspace/magento2/app/code/Excercise/Weblog/Block/Adminhtml/Blogpost/Edit.php(39): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined prope...', '/opt/lampp/htdo...', 39, Array)
@aishwaryacedcoss Make your block extend \Magento\Backend\Block\Widget\Form\Container
because that's what the edit block is...a form container. But that's not really important, you should still be able to access the buttonList
member. Since your class extends \Magento\Backend\Block\Widget\Container
that has a member buttonList
it should be available in the child classes. Clear the cache and var/generation just to be safe.
@aishwaryacedcoss, did advice from @tzyganu help you resolve your issue? Please let us know whether you need additional assistance from someone from the team.
Sorry the dealyed reply .. yes my Problem is not resolved yet ..it is giving same error
It is saying :- undefined property: Excercise\Weblog\Block\Adminhtml\Blogpost\Edit::$buttonList in /opt/lampp/htdocs/workspace/magento2/app/code/Excercise/Weblog/Block/Adminhtml/Blogpost/Edit.php on line 39";i...
@aishwaryacedcoss can you try calling the inherited updateButton method?
If that still doesn't work can you post your latest code so we can help further?
@aishwaryacedcoss, since we haven't heard back from you, we'll proceed with closing this issue. If in case you do have any updates, feel free to reach out to us by submitting a new issue.
I have created a edit form functions some thing like this:-
namespace Excercise\Weblog\Block\Adminhtml\Blogpost;
class Edit extends \Magento\Backend\Block\Widget\Container { protected $_coreRegistry = null;
Then Error comes as:- a:4:{i:0;s:142:"Invalid method Excercise\Weblog\Block\Adminhtml\Blogpost\Edit::_updateButton(Array ( [0] => save [1] => label [2] => Save Post )
I cant understand where the Problem is existing????Please help me???,my edit controller is:-
namespace Excercise\Weblog\Controller\Adminhtml\Blogpost;
class Edit extends \Excercise\Weblog\Controller\Adminhtml\Blogpost\Index {
}