For my Project i need to render a custom form field based on the ListField I try to use the "new" conventions for J4 and later using namespacing etc.
this is the relevant part of my xml:
...
<namespace path="src">NXD\Module\FootballManagerPlayers</namespace>
...
<config>
<fields name="params">
<fieldset name="basic"
addfieldpath="/modules/mod_nxdfm2_players/src/models/fields"
>
<field name="team_id"
type="TeamSelect"
label="MOD_NXDFM2_PLAYERS_TEAM_FILTER_LABEL"
description="MOD_NXDFM2_PLAYERS_FILTER_DESC"
default=""
show_select="true">
</field>
</fieldset>
...
I've tried to place the FieldClass PHP on different locations within my module wihtout success. Currently the "TeamSelectField.php" is stored under "modules/mod_nxdfm2_players/src/models/fields" (But I think thats not correct?)
My TeamSelectField.php:
...
namespace NXD\Module\FootballmanagerPlayers\Fields;
defined('_JEXEC') or die;
...
class TeamSelectField extends ListField
{
protected $type = 'TeamSelect';
...
protected function getInput()
{
...
}
protected function getOptions()
{
...
}
...
I'm using Dispatcher.php aswell as the service provider interface... github Link to module code: Link
I've tried different location that's why there are currently multiple "TeamSelectField.php" files in different locations like root/fields, src/Fields, src/models/fields , ....
I've used custom form field types already a few times in Joomla 3 / 4 by using the "old fashioned way" without issues. I'm aware that the conventions are strict but i didn't find any ressource on how to use it "the new way". Any suggestions hints are much appreciated.
Edit Also adding the addFieldPrefix does not change anything:
...
<fieldset name="basic"
addfieldpath="/modules/mod_nxdfm2_players/src/models/fields"
addfieldprefix="NXD\Module\FootballmanagerPlayers\Field">
...