Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Urgent Help..!! Dropdown functional

Avatar

Level 2

Hi,

I have an dropdown for that am Adding values dynamically. Below I the script am using on exit event

Var val = this.rawValue;

this.additem(val);

When the values get added, when am selecting the previous values and exit the feild that value is getting add twice.

Could you please help me in the modifying the script, where its should not repeat the selected values from the dropdown.

Thanks in advacne

1 Reply

Avatar

Level 10

Hi,

I think you need to use the boundItem method, something like;

if (!this.isNull)

{

    if (this.boundItem(this.rawValue) === "")

    {

        this.addItem(this.rawValue);

    }

}

So if the value is not null and then not already in the list add the value.

Regards

Bruce