Hi,
Sorrry to disturb, but something it is not working !
i repeat again the problem:
i have a table named samples with the following variables:
id (integer)
sample (text)
samplecode (text)
exchange_date (date)
origin_id (select box)
destination_id (select box)
I did a collection view, an item view, edit, delete, etc.. everything fine !
On the grid view i want an icon (or text) on each line to create a new entry taking some values of the selected item on the following way:
sample = old sample
samplecode = old samplecode
exchange_date = empty
origin_id = old destination_id
destination_id = empty
so i want to take this values and to display the item view in edit mode to fullfil the date, destination,etc..
so, i tried everything, it must be simple but it doesn't work !
I followed the link you passed to me:
on the item controller:public function duplicate()
{
JRequest::checkToken() or JRequest::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));
//Check the ACLs
$model = $this->getModel();
$item = $model->getItem();
if (!$model->canEdit($item))
return false;
$result = parent::save();
//Catch the initializated JModel trough postSaveHook()
$model = $this->model;
//Define the redirections
switch($this->getLayout() .'.'. $this->getTask())
{
case 'samplesitem.duplicate':
$this->applyRedirection($result, array(
'com_samplestracking.samplesitem.samplesitem',
'com_samplestracking.samplesitem.samplesitem'
), array(
'cid[]' => $model->getState('samplesitem.id')
//'filter_some_id' => $model->getState('yourcurrentlayoutname.id')
));
break;
}
}
I CREATE THE SUBMIT - in administrator/components/com_yourcomponent/dom/html/toolbar/button.php
and TASK SWITCH - create case for the custom button
in administrator/components/com_yourcomponent/dom/dom.php
and i obtain blank
on the other hand i try to work as you advice me on the save case, but i do not arrive there easily, and on the other hand i can't modify fields.
Sorry to derange you, but it should be easy, but i do not know how.
In case i do not solve, i will do a separate view with home made code !! but it is a pity having your powerful structure already done.
thanks in advance