<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset name="clubpeoplefields">
<field type="subform"
name="add_people"
label="PEOPLE_FIELDS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="PEOPLE_FIELDS_DESC"
icon="list"
min="1"
max="50">
<form hidden="true" name="list_addpeople_views_modal" repeat="true">
<field name="ponr"
type="text"
class="inputbox"
size="16"
label="PEOPLE_FIELD_PONR_LABEL"
description="PEOPLE_FIELD_PONR_DESC"
required="true"
/>
<field name="posc"
type="text"
class="inputbox"
size="16"
label="PEOPLE_FIELD_POSC_LABEL"
description="PEOPLE_FIELD_POSC_DESC"
required="true"
/>
<field name="posn"
type="text"
class="inputbox"
size="64"
label="PEOPLE_FIELD_POSN_LABEL"
description="PEOPLE_FIELD_POSN_DESC"
required="true"
/>
</form>
</field>
</fieldset>
<field name="state"
type="list"
label="JSTATUS"
description="JFIELD_PUBLISHED_DESC"
class="inputbox small"
size="1" default="1" >
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
<option value="2">JARCHIVED</option>
<option value="-2">JTRASHED</option>
</field>
</form>--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/joomla-dev-general/7a93803f-092d-4c2b-8004-709fc3a39542o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.


Hello,im not an expert but i have always used subforms giving the field type subform as you did, but linkin the file of subform with "formsource" did you try this way?
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/joomla-dev-general/6274d55a-6ba9-478c-bddc-929ec1cbad26n%40googlegroups.com.
On 28 Jun 2020, at 18:21, Mark Dexter <dexter...@gmail.com> wrote:for a subform: do I have to to write my 'own' public save function for the controller/model
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/joomla-dev-general/6274d55a-6ba9-478c-bddc-929ec1cbad26n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/joomla-dev-general/46e4e7bf-e605-4816-be4d-43272e6a952co%40googlegroups.com.
public function save($data = array(), $key = 'id') {
//TODO: how tokens work
//$this->checkToken();
$input = JFactory::getApplication()->input;
$data = $input->get(jform, array(), 'array' );
echo 'Controller add_people.php: '.var_dump($data).'<br />';
$model = $this->getModel();
$model->save($data);
//return;
//TODO: After pressing save, what needs to be the return url? Now it returns to the 'default' list view and away from the details page!!??? (but that is an issue for later)
$this->setRedirect(JRoute::_("index.php?option=com_people&view=add_people&layout=edit"), "Records saved");
}
protected function postSaveHook(JModelLegacy $model, $validData = array()) {
return;
}
array (size=3)
'add_people' =>
array (size=2)
'add_people0' =>
array (size=3)
'ponr' => string '78' (length=2)
'posc' => string 'XY' (length=2)
'posn' => string 'Front' (length=5)
'add_people1' =>
array (size=3)
'ponr' => string '88' (length=2)
'posc' => string 'YZ' (length=2)
'posn' => string 'Behind' (length=6)
'state' => string '1' (length=1)
'language' => string '' (length=0)public function save($data) {
$add_people = new JRegistry;
$add_people->loadArray($data['add_people']);
$data['add_people'] = (string) $add_people;
echo '1. $data[add_people] Dit is de save functie in de model add_people.php: '.var_dump($data['add_people']).'<br />';
if (!isset($data['add_people'])) {
$data['add_people'] = array();
}
return parent::save($data);
}
public function validate($form, $data, $group = null) {
$data['add_people'] = json_encode($data['add_people']);
return parent::validate($form, $data, $group);
} '{"add_people0":{"ponr":"78","posc":"XY","posn":"Front"},"add_people1":{"ponr":"88","posc":"YZ","posn":"Behind"}}'{"add_people0":{"ponr":"78","posc":"XY","posn":"Front"},"add_people1":{"ponr":"88","posc":"YZ","posn":"Behind"}}<?php echo JLayoutHelper::render('people_field_view.details', $this); ?>$form = $displayData->getForm();
//$form = $forms[0]; //joomla stackoverflow
$layout_path_array = explode('.', $this->getLayoutId());
$fields_tab_layout = 'fields_' . $layout_path_array[1];
// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'add_people'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical">
<?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?>
</div>
<?php endif; ?>--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/joomla-dev-general/6D3B84FF-A103-4C57-8776-3B7F30D0395E%40gmail.com.
-- Troy Hall