public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_yourcomponent.product', 'product', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
}
// This section loads the metadata and injects it into the form we are returning
$metaDataTable = parent::getTable('MetaData', 'YourComponentTable', $config = array());
$metaDataTable->load($this->getItem()->guid);
$form->bind($metaDataTable);
return $form;
}
3. Override the save method of your model in question like the following:
public function save($data)
{
$result = parent::save($data);
if($result)
{
// save the metadata
$metaDataTable = parent::getTable('MetaData', 'YourComponentTable', $config = array());
$result = $metaDataTable->save($data);
}
return $result;
}