Add listener ro FormLayout icon


I’m trying to develop some forms that expand / collapse when an image button is clicked.

But what I really would like was to move that image to the icon next to the FormLayout caption and add it a listener, or add a listener to the entire caption area, like in this demo:

Is it possible to, and how can it be done?

Thanks for your help.

Hi again.

Instead of a FormLayout, is it possible to add the same listener but to a Panel caption area?


this add-on
does more or less what you want (with a little bit of themeing).

Thanks, I will see this addon.