I'm lost with utilising com_fields in my component so that my users can create a custom field for a specific purpose and have it rendered in a modal popup.
So I have my component setup with a dashboard and the option for admins to create custom fields and groups, this all works fine and dandy. In the admin side edit.php of an item I can actually see a list of custom fields available that have been created and select one from the list as a reference to the specific item. Now I wish to display/render the chosen field in my modal popup. I assumed I should be able to use the following to render the field like this:
<?php echo $this->form->renderField('id'); ?>
<?php echo $this->form->renderField('field_id'); ?>
<?php echo $this->form->renderField('user_id'); ?>
<?php if ($this->item->field_id) : ?>
<?php $fields = FieldsHelper::getFields('com_mycomponent.recordform', $this->item, true); ?>
<?php echo $this->form->renderField($fields[0]->name); ?>
<?php endif; ?>
My tmpl file is called modalrec.php and the model being used is recordform.php. I've seen mention of needing to have a plugin to trigger an event which I don't understand. Surely if I have the fields setup (in this case a radio field with 3 options) I can simply get the field and show the options available. But alas I can't see it. Any guidance appreciated.