I am rather new to Joomla development and have been slowly working on a simple MVC Component. All was going well until I began to try to edit data from the database. The SAVE and CANCEL buttons do not do anything when clicked.I have an edit view:
Code:
<?php
defined( '_JEXEC' ) or die;jimport( 'joomla.application.component.view');
class CoursesViewCourse extends JViewLegacy
{
protected $item;
protected $form;public function display($tpl = null)
{
$this->item = $this->get('Item');
$this->form = $this->get('Form');$this->addToolbar();
parent::display($tpl);
}public function addToolbar()
{
if ($this->item->course_id) {
JToolBarHelper::title(JText::_('COM_EXPLORE_EDIT_ACTIVITIES_TITLE'));
} else {
JToolBarHelper::title(JText::_('COM_EXPLORE_ADD_ACTIVITIES_TITLE'));
}
JToolBarHelper::save('course.save');
JToolBarHelper::cancel('course.cancel');
}
}
Then I have a controller called 'course' as above attached to the JToolBarHelper::save and ::cancel functions:
Code:
<?php
defined( '_JEXEC' ) or die;jimport('joomla.application.component.controllerform');
class CoursesControllerCourse extends JControllerForm
{
protected $view_list = 'courses';
}
I am able to pull in the data from the database when I click on an individual item in the 'courses' view but the button dont function whether I am editing or creating a new record. If I am correctly understanding the syntax then the JToolBarHelper is a method within the JControllerForm class. So I don't need to add any functions to the ::save and ::cancel because they are part of the parent class. Is this correct?Any advice on what I may be missing?
Thanks,
seeward
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
For more options, visit https://groups.google.com/groups/opt_out.
--Olivier Nolbert, Jiliko![]()
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
For more options, visit https://groups.google.com/groups/opt_out.