Hallo, meine Komponente ist fast fertig und läuft auf meiner localen testumgebung einwandfrei.
Problem ist die Funktion Apply(), local funktioniert alles , auf dem Webserver hingegen fällt man aus dem Formular zurück in die Liste wie bei der SAVE funktion.
Hier mal der code aus dem Admin controller:
die View.html:PHP-Code:<?php
/**
* @version SVN: $Id$
*
* @license GNU/GPL
*/
//-- No direct access
defined('_JEXEC') or die('=;)');
jimport('joomla.application.component.controller');
$task = JRequest::getCmd( 'task' );
/**
* CadNet Controller
*
* @package CadNet
* @subpackage Controllers
*/
class CadNetListControllerCadNet extends CadNetListController
{
/**
* constructor (registers additional tasks to methods)
* @return void
*/
function __construct()
{
parent::__construct();
//-- Register Extra tasks
$this->registerTask('add', 'edit','remove','apply');
}// function
/**
* display the edit form
* @return void
*/
function edit()
{
JRequest::setVar('view', 'CadNet');
JRequest::setVar('layout', 'form');
JRequest::setVar('hidemainmenu', 1);
parent::display();
}// function
/**
* save a record (and redirect to main page)
* @return void
*/
function save()
{
$model = $this->getModel('CadNet');
if($model->store())
{
$msg = JText::_('Eintrag gespeichert');
}
else
{
$msg = JText::_('Fehler beim Speichern');
}
//neue apply variante
switch ($task)
{
case 'apply':
$link = 'index.php?option=com_cadnet&vers=switcher&task=edit&cid[]='. $row->bid ;
break;
case 'save':
default:
$link = 'index.php?option=com_cadnet';
break;
}
//neue aplly variante
//$link = 'index.php?option=com_cadnet';
$this->setRedirect($link, $msg);
}// function
/**
* remove record(s)
* @return void
*/
function remove()
{
$model = $this->getModel('CadNet');
if(!$model->delete()){
$msg = JText::_('Error: One or More Records Could not be Deleted');
} else {
$msg = JText::_('Records Deleted');
}
$this->setRedirect('index.php?option=com_cadnet', $msg);
}// function
/**
* cancel editing a record
* @return void
*/
function cancel()
{
$msg = JText::_('Operation Abgebrochen');
$this->setRedirect('index.php?option=com_cadnet', $msg);
}//function
//////APPLY FUNKTION
function apply()
{
$model = $this->getModel('CadNet');
$ret=$model->store();
if ($ret) {
$msg = JText::_( 'Eintrag gespeichert!' );
} else {
$msg = JText::_( 'Error Saving' );
}
JRequest::setVar( 'view', 'CadNet' );
JRequest::setVar( 'layout', 'form' );
JRequest::setVar('hidemainmenu', 1);
$link = 'index.php?option=com_cadnet&controller=CadNet&task=edit&cid[]='.$ret;
$this->setRedirect($link, $msg);
}
}//class
Wie gesagt, local läuft alles bestens.PHP-Code:<?php
/**
* @version SVN: $Id$
* @package test
* @author Created on 02-Jul-2011
* @license GNU/GPL
*/
//-- No direct access
defined('_JEXEC') or die('=;)');
jimport( 'joomla.application.component.view');
/**
* HTML View class for the test Component
*
* @package test
* @subpackage Views
*/
class CadNetListViewCadNet extends JView
{
/**
* test view display method
*
* @return void
**/
function display($tpl = null)
{
//-- Get the CadNet
$cadnet =& $this->get('Data');
$isNew = ($cadnet->id < 1);
$text = $isNew ? JText::_('New') : JText::_('Edit');
JToolBarHelper::title('CadNet MAP: <small><small>[ '.$text.' ]</small></small>');
JToolBarHelper::save();
//JToolBarHelper:: apply ();
JToolBarHelper::apply('apply');
if($isNew)
{
JToolBarHelper::cancel();
}
else
{
//-- For existing items the button is renamed `close`
JToolBarHelper::cancel('cancel', JText::_('Close'));
}
$this->assignRef('CadNet', $cadnet);
parent::display($tpl);
}//function
}//class
Hat jemand ne Idee woran das liegen könnte ?![]()


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen