code: public void init() {
          if (FacesContext.getCurrentInstance().getPartialViewContext().isAjaxRequest()) {
              return;
          }
  
          if (id != null && !"".equals(id)) {
              entity = crudService.findById(id);
              if (entity == null) {
                  log.info(String.format("Entity not found with id %s, a new one will be initialized.", id));
                  id = null;
                  entity = initEntity();
              }
          }
      }
docs: called via preRenderView or viewAction