I would try to get the id/pid from the Request.
The Joomla way:
JFactory::getApplication()->input->getInt('pid')
Mostly you don't have to override method getInput() only getOptions() in
your JFormFieldList override.
Ove
Lorisidae wrote On 18.04.2013 05:14:
> I am developing an admin component that has a form with a multi-select list. The default values of the list are retrieved from a joined database query - which depends on the ID of the selected item. How do I access the ID from within my extended JFormFieldList class?
>
> The general approach is as outlined in:
>
http://docs.joomla.org/Creating_a_custom_form_field_type
>
> The XML file (../models/forms/xyz.xml) defines the field with multiple="true".
> The class file (../models/fields/abc.php) overrides getInput() and contains SQL to extract both the option list and the default values.
>
> Investigation so far has identified $this->element['pid'] as a vehicle for passing the parameter, but all the example for the accompanying XML I have found are for static values.
>
> So my question is: how do I dynamically assign the XML element ('pid') to have a value of $this->item->id as it is defined in the View (e.g. ../views/xyz/tmpl/edit.php)?
>
> Thanks in advance for your help!
>