I need a custom field which has to select the database with some conditions. When customer A logged in this field has to select records belong to customer A only.
The custom field is as below
JFormHelper::loadFieldClass('list');
class JFormFieldGroupList extends JFormFieldList{
protected $type='grouplist'
public function getOptions($id=''){
$options = array();
//connect to database and get the records
//Form the value and text
return $options
}
}
In the XML
<field name="grouplist"
multiple="true"
type="grouplist"
label="Group"/>
In the default.php
echo $this->form->renderField('grouplist',null,$default_group);
The question is I want to pass a value from default.php to the custom field so that I can put a conditional select query while fetching data from the database.