Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Custom Dropdown code in coral3 throwing exception

Avatar

Level 4

I have written some code for select dynamic drop down, some where form the code the error is propagated to coralui3. When I debug the code I don't see any error coming form custom code, everything seems to be pointing to coralui3. 

 

Uncaught TypeError: Cannot read property 'indexOf' of undefined
at HTMLElement._onItemAdded (coralui3.js:28505)
at HTMLElement._onItemSelected (coralui3.js:28556)
at HTMLElement._onItemSelectedChange (coralui3.js:28961)
at Vent._executeListenersAtElement (coralui3.js:4147)
at Vent._executeBubbleListeners (coralui3.js:4256)
at HTMLElement.Coral.Component.trigger (coralui3.js:8729)
at HTMLElement.doTrigger (coralui3.js:6046)
at HTMLElement.setter [as selected] (coralui3.js:6216)
at HTMLElement.Coral.Component.attributeChangedCallback (coralui3.js:8377)
at HTMLElement.o (coralui3.js:3881)

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @shajiahmed , 

 

Custom code must be making the call to coral js. As per the the error indexOf is called on undefined obj.

Please back trace the code to understand how HTMLElement._onItemAdded will be called. 

Setting the break point and debug in the developer tool will help. 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @shajiahmed , 

 

Custom code must be making the call to coral js. As per the the error indexOf is called on undefined obj.

Please back trace the code to understand how HTMLElement._onItemAdded will be called. 

Setting the break point and debug in the developer tool will help.