title: Joomla: error while saving form in custom view
body: <p>I have created a custom component with form to update prices of four product to be displayed on frontend. </p>
  
  <p>My main controller code is here:</p>
  
  <pre><code>public function display($cachable = false, $urlparams = false) {
  
      require_once JPATH_COMPONENT.'/helpers/calculator.php';
  
      $view       = JFactory::getApplication()-&gt;input-&gt;getCmd('view', 'pricetable');
      $layout     = JFactory::getApplication()-&gt;input-&gt;getCmd('layout', 'edit');
  
      JFactory::getApplication()-&gt;input-&gt;set( 'layout', $layout );
      JFactory::getApplication()-&gt;input-&gt;set('view', $view);
      JFactory::getApplication()-&gt;input-&gt;set('id', 1);
  
      parent::display($cachable, $urlparams);
      return $this;
  }
  </code></pre>
  
  <p>id is set to 1 so it loads only first row from database. </p>
  
  <p>code for pricetable container is:</p>
  
  <pre><code>function __construct() {
      $this-&gt;view_list = 'pricetable';
      parent::__construct();
  }
  </code></pre>
  
  <p>Now in admin backend the form is loaded as desired with the first row of data. 
  When I try to save the form it is redirected to <code>administrator/index.php?option=com_calculator&amp;view=pricetable</code> and error is:</p>
  
  <blockquote>
    <p>Error: You are not permitted to use that link to directly access that
    page (#1).</p>
  </blockquote>
  
  <p>my form action is: </p>
  
  <pre><code>&lt;?php echo JRoute::_('index.php?option=com_calculator&amp;task=pricetable.edit&amp;id='.(int) $this-&gt;item-&gt;id); ?&gt;
  </code></pre>
  
  <p>Please suggest where I am doing wrong. It is third day I'm scratching my head. :(</p>