Hi, I have a main function that prints two buttons in the screen:
public function main(){
print('<a class="epesi_big_button bigger" '.$this->create_callback_href(array($this,'consulta_horas_user')).'>Hours User</a>');
print('<a class="epesi_big_button bigger" '.$this->create_callback_href(array($this,'admin_tickets'),array(true)).'>Admin Tickets</a>');
return true;
}
Then, in the function"consulta_horas_user" I have a form using QuickForm. This forms takes the user options and prints the results of a Query.
I click on the "Hours User" button and the form is displayed:
public function consulta_horas_user(){
Base_ActionBarCommon::add('back', __('Back'), $this->create_callback_href(array($this,'main')));
. . .
$form = $this->init_module('Libs/QuickForm');
$form->addElement('datepicker', iDate_ini, 'Initial date');
$form->addElement('datepicker', iDate_fin, 'Final date');
$form->addElement('select', 'iOrdena', 'Order by ', $array_ordena);
$form->addElement('submit','submit_button','Search');
if ($form->validate()) {
$values = $form->exportValues();
$this->show_results($values);
. . .
}
$form->display();
return true;
}
I can use the Submit button and the Query result is displayed. It works Ok.
The problem is when I click the "Back" button on the form screen:
Base_ActionBarCommon::add('back', __('Back'), $this->create_callback_href(array($this,'main')));
When I press the Back button, the first screen is displayed. Ok.
But if I click on the "Hours User" button, the form is displayed but it doesn't work. If I press the submit button, the form disappears and the firs screen (main) is showed again. Why?
How Can I navigate between pages and make the form works correctly the second time??