Correct configuration of tokenList component

I’m trying to get the TokenList component to work, it’s supposed to be correctly configured but when I try to use it it just doesn’t work and doesn’t flag an error either.

I’ve got the following:

Fiscal responsability entity

@NamePattern(value = "%s|description")
@Table(name = "HET_FISCAL_RESPONSIBILITY", indexes = [
    Index(name = "IDX_HET_FISCAL_RESPONSIBILITY_01", columnList = "DESCRIPTION")
], uniqueConstraints = [
    UniqueConstraint(name = "IDX_HET_FISCAL_RESPONSIBILITY_UNQ", columnNames = ["IDENTIFICATION"])
@Entity(name = "het_FiscalResponsibility")
class FiscalResponsibility : BasicField() {

    companion object {
        private const val serialVersionUID = -1225558278840943983L

Relational entity (detail)

@NamePattern(value = "%s|fiscalResponsability")
@Table(name = "HET_INTERNATIONAL_FSCL_RSPNSBLTY", uniqueConstraints = [
@Entity(name = "het_InternationalFiscalResponsability")
class InternationalFiscalResponsability : Identificador() {

    @Lookup(type = LookupType.DROPDOWN, actions = [])
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "INTERNATIONAL_MARKETER_ID")
    var internationalMarketer: InternationalMarketer? = null

    @Lookup(type = LookupType.DROPDOWN, actions = [])
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "FISCAL_RESPONSABILITY_ID")
    var fiscalResponsability: FiscalResponsibility? = null

    companion object {
        private const val serialVersionUID = 5799073036678630010L

Master Entity

@NamePattern(value = "%s|businessName")
@Table(name = "HET_INTERNATIONAL_MRKTR", uniqueConstraints = [
    UniqueConstraint(name = "IDX_HET_INTERNATIONAL_MARKETER_UNQ", columnNames = ["IDENTIFICATION"])
@Entity(name = "het_InternationalMarketer")
class InternationalMarketer : Identificador() {

    @Column(name = "IDENTIFICATION", nullable = false, length = 20)
    var identification: String? = null

    @Lookup(type = LookupType.DROPDOWN, actions = ["lookup", "open"])
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "IDENTIFICATION_TYPE_ID")
    var identificationType: IdentificationType? = null

    @Column(name = "BUSINESS_NAME", nullable = false, length = 120)
    var businessName: String? = null

    @Column(name = "PERSON_TYPE", nullable = false)
    private var personType: Int? = null

    @Lookup(type = LookupType.DROPDOWN, actions = ["lookup", "open"])
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "CURRENCY_ID")
    var currency: Currency? = null

    @Lookup(type = LookupType.DROPDOWN, actions = ["lookup", "open"])
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "CIIU_CODE_ID")
    var ciiuCode: CiiuCode? = null

    @OneToMany(mappedBy = "internationalMarketer", cascade = [CascadeType.PERSIST])
    var responsibilities: MutableList<InternationalFiscalResponsability>? = mutableListOf()

    fun getPersonType(): PersonType? = personType?.let { PersonType.fromId(it) }

    fun setPersonType(personType: PersonType?) {
        this.personType = personType?.id

    companion object {
        private const val serialVersionUID = 9042427494405307321L

in my editor

        <instance id="internationalMarketerDc"
            <collection id="responsibilitiesDc" property="responsibilities"/>    
<collection id="fiscalResponsibilityDc" class="com.treze.sw.het.entity.catalogs.taxes.FiscalResponsibility"
            <loader id="fiscalResponsibilityLc">
                    <![CDATA[select e from het_FiscalResponsibility e where e.hidden <> true order by e.description asc]]>
<layout expand="optionBox" spacing="true">
                      <form dataContainer="internationalMarketerDc">
                            <column width="740px">
                                <tokenList dataContainer="responsibilitiesDc" property="fiscalResponsability" inline="true">
                                    <lookup optionsContainer="fiscalResponsibilityDc"/>
                                    <clearButton caption="" icon="font-icon:REMOVE"/>

All of the above should work, but it doesn’t.

I appreciate any help.


Nelson F.

The configuration for token list for n-n relationship between A & B.

If being used in A screens.
Datacontainer - Adc
OptionContainer - Bdc (not the relationship table/entity but B)
property - Attribute in A.

It works very well for direct relationship (with no relationship entity).
I have not used it in case of indirect n-n relationship. (but if you are using token list then direct relationship is sufficient as you are not going to input some other data in relationship entity).

If I get your code correctly and tokenlist works for n-n indirecct relationships-
Why datacontainer for token list is responsibilitiesDc It should be internationalMarketerDc




In your case, the correct tokenList definition looks as follows:

<tokenList dataContainer="internationalMarketerDc" property="responsibilities" ...