Switch widget unable to be used in accordion in Mendix 9

0
Hi, I have encountered an issue where I can't place Switch widget in accordion. If I do so, this error is shown:Widget accordion 'accordion2' cannot contain widgets of type switchMay I know if anyone encountered this issue before and how to resolve this?
asked
1 answers
0

Hi Ariff,

This is usually not an Accordion issue itself. The error:


Plain Text



Widget accordion 'accordion2' cannot contain widgets of type switch

means the Switch widget's widget definition does not allow it to be placed inside the container type used by the Accordion.

A few things to check:

  • Which Accordion widget are you using (Atlas Accordion, Accordion Plus, CommunityCommons-based, etc.)?
  • Which Switch widget are you using (Marketplace Switch, Toggle Switch, Mendix Switch, custom widget)?

I've seen this happen when one of the widgets has restrictive placement rules defined in its widget XML. In that case, Studio Pro blocks the combination even though it might work conceptually.

As a workaround, try:


Plain Text



Accordion

└── Container

└── Switch

instead of placing the Switch directly inside the Accordion pane.

If the error still occurs, it's likely a compatibility limitation between those specific widget versions rather than your page design.

Since you're on Mendix 9, I'd also check whether newer versions of the Accordion and Switch widgets are available in the Marketplace. A number of older widgets had placement restrictions that were relaxed in later releases.

In short, this is most likely a widget compatibility/containment rule issue, not something wrong with your page. Knowing the exact Accordion and Switch widget versions would help identify whether it's a known limitation.


answered