code: @Override
  	protected void preparePaintComponent(final Request request) {
  		super.preparePaintComponent(request);
  
  		String targetId = getContent().getId();
  		String contentId = getId() + "-content";
  
  		switch (getComponentModel().mode) {
  			case LAZY: {
  				getContent().setVisible(isOpen());
  				AjaxHelper.registerContainer(getId(), contentId, targetId);
  				break;
  			}
  			case DYNAMIC: {
  				AjaxHelper.registerContainer(getId(), contentId, targetId);
  				getContent().setVisible(isOpen());
  				break;
  			}
  			case EAGER: {
  				AjaxHelper.registerContainer(getId(), contentId, targetId);
  				// Will always be visible
  				break;
  			}
  			case SERVER: {
  				// same as DYNAMIC
  				AjaxHelper.registerContainer(getId(), contentId, targetId);
  				getContent().setVisible(isOpen());
  				break;
  			}
  			case CLIENT: {
  				// Will always be visible
  				break;
  			}
  
  			default:
  				// do nothing.
  				break;
  		}
  	}
docs: Override preparePaintComponent in order to correct the visibility of the sub-menu's children before they are
  rendered.
  
  @param request the request being responded to.