I would probably give the side well an id in the HTML. Then you can inspect the contents of the well in the afterRender method of your layout
void afterRender(MarkupWriter writer) { Element sideWell = writer.getDocument().getElementById("wellId"); if (!sideWell.getChildren().isEmpty()) { // do stuff here } }