code: @Override
  	protected void preparePaintComponent(final Request request) {
  		super.preparePaintComponent(request);
  
  		// If is an internal AJAX action, set the action type.
  		if (isCurrentAjaxTrigger()) {
  			AjaxOperation operation = AjaxHelper.getCurrentOperation();
  			if (operation.isInternalAjaxRequest()) {
  				// Want to replace children in the target (Internal defaults to REPLACE target)
  				operation.setAction(AjaxOperation.AjaxAction.IN);
  			}
  		}
  		// Check if a custom tree needs the expanded rows checked
  		TreeItemIdNode custom = getCustomTree();
  		if (custom != null) {
  			checkExpandedCustomNodes();
  		}
  
  		// Make sure the ID maps are up to date
  		clearItemIdMaps();
  		if (getExpandMode() == ExpandMode.LAZY) {
  			if (AjaxHelper.getCurrentOperation() == null) {
  				clearPrevExpandedRows();
  			} else {
  				addPrevExpandedCurrent();
  			}
  		}
  	}
docs: Override preparePaint to register an AJAX operation.
  
  @param request the request being responded to.