ClickEvent on CustomLayout

Hi,
Is there a way to detect a click event on a CustomLayout?
I have a class that extends CustomLayout and I would like to know if anyone clicks on any area in the layout.
The code is as follows:


public class Tile extends CustomLayout implements LayoutClickNotifier {
	
	String title = null;
	private static Logger log=Logger.getLogger(Tile.class);
	private static final String CLICK_EVENT = EventId.LAYOUT_CLICK;
	
	public Tile(){
		this("tile");
	}
	public Tile(String tileStyle){
		super(tileStyle);
		addListener(new LayoutClickListener(){

			@Override
			public void layoutClick(LayoutClickEvent event) {
				log.debug("CLICK");
			}
			
		});
	}
	public Tile(String title, String tileStyle){
		this(tileStyle);
		setTitle(title);
	}

	public void setTitle(String title){
		addComponent(new Label(title), "title");
		this.title = title;
	}
	
	@Override
	public void addComponent(Component c) {
		addComponent(c,"content");
	}
	@Override
	public void addListener(LayoutClickListener listener) {
		addListener(CLICK_EVENT, LayoutClickEvent.class, listener,
                LayoutClickListener.clickMethod);
		
	}
	@Override
	public void removeListener(LayoutClickListener listener) {
		removeListener(CLICK_EVENT, LayoutClickEvent.class, listener);
		
	}
	
}

I’ve tried to do this using the Vaadin source and example for how it’s implemented in GridLayout, however I found this link that basically implies that
Clickable Layout is not supported for CustomLayout
. Does anyone know if this is possible at all?

It is not enough to add the listeners on the server side - also the client side implementation (extending VCustomLayout in your widgetset) would need to support this.

However, you might be able to do this by wrapping a CustomLayout in a CssLayout, which does support layout click listeners.


Henry
kindly suggested
here
to use
ClickableCustomLayout
. Perhaps you will draw some other ideas from that thread.