php - Joomla: error while saving form in custom view -
i have created custom component form update prices of 4 product displayed on frontend.
my main controller code here:
public function display($cachable = false, $urlparams = false) { require_once jpath_component.'/helpers/calculator.php'; $view = jfactory::getapplication()->input->getcmd('view', 'pricetable'); $layout = jfactory::getapplication()->input->getcmd('layout', 'edit'); jfactory::getapplication()->input->set( 'layout', $layout ); jfactory::getapplication()->input->set('view', $view); jfactory::getapplication()->input->set('id', 1); parent::display($cachable, $urlparams); return $this; }
id set 1 loads first row database.
code pricetable container is:
function __construct() { $this->view_list = 'pricetable'; parent::__construct(); }
now in admin backend form loaded desired first row of data. when try save form redirected administrator/index.php?option=com_calculator&view=pricetable
, error is:
error: not permitted use link directly access page (#1).
my form action is:
<?php echo jroute::_('index.php?option=com_calculator&task=pricetable.edit&id='.(int) $this->item->id); ?>
please suggest doing wrong. third day i'm scratching head. :(
you can updating actions (or calling them) inside code whenever is. new instance or update new - add 1 more if
in code , hidden
input on form. example:
<input type="hidden" name="task" value="update" />
Comments
Post a Comment