I'm developing the second view of my back end component in Joomla!2.5. The first two screens - the first page where I list questions and answers, and the question editing/adding page, both work. The third view, supposed to show and add new school subjects to which these questions will be attached to loads like a wonder... But the toolbar doesn't work at all.
All the folders listed below are in the admin folder. Everything is being done trying to follow the MVC standards.
Part of the views/reforcodigitals/view.html.php (where it leads into the "Add subject page"):
JToolBarHelper::custom('disciplina.add', 'archive', 'archive', 'Disciplinas', false);
views/disciplina/view.html.php's toolbar setup:
protected function addToolBar(){
$input = JFactory::getApplication()->input;
$input->set('hidemainmenu', true);
JToolBarHelper::title('Disciplinas');
JToolBarHelper::save2new('disciplina.save');
JToolBarHelper::cancel('disciplina.cancel', 'Voltar');
}
views/disciplina/tmpl/edit.php form set up:
<?php
defined('_JEXEC') or die('Restricted Access');
JHtml::_('behavior.tooltip');
?>
<form action="<?php echo JRoute::_('index.php?option=com_reforcodigital&view=disciplina&layout=edit'); ?>" method="post" name="adminForm" id="adminForm">
<fieldset class="adminform">
<legend>Detalhes</legend>
<ul class="adminformlist">
<?php foreach($this->form->getFieldset() as $field): ?>
<li><?php echo $field->label; echo $field->input; ?></li>
<?php endforeach; ?>
</ul>
</fieldset>
</form>
I'll gladly update with model/controller/helper code if it's needed. I just don't know what could be happening here.
Edit: I added the following line to my views/disciplina/edit.php's form:
<input type="hidden" name="task" value="disciplina.add" />
And it now returns me what seems to be a JINVALID_TOKEN.