@Override
  protected void OnEntityChanged() {
    super.OnEntityChanged();

    getSearchCommand().Execute();
    UpdateActionAvailability();
  }
  @Override
  protected void AsyncSearch() {
    super.AsyncSearch();

    setAsyncResult(
        Frontend.RegisterQuery(
            VdcQueryType.GetTemplateInterfacesByTemplateId,
            new GetVmTemplateParameters(getEntityStronglyTyped().getId())));
    setItems(getAsyncResult().getData());
  }
  @Override
  protected void SyncSearch() {
    if (getEntity() == null) {
      return;
    }

    super.SyncSearch(
        VdcQueryType.GetTemplateInterfacesByTemplateId,
        new GetVmTemplateParameters(getEntityStronglyTyped().getId()));
  }
  @Override
  public void ExecuteCommand(UICommand command) {
    super.ExecuteCommand(command);

    if (command == getNewCommand()) {
      New();
    } else if (command == getEditCommand()) {
      Edit();
    } else if (command == getRemoveCommand()) {
      remove();
    } else if (StringHelper.stringsEqual(command.getName(), "OnSave")) {
      OnSave();
    } else if (StringHelper.stringsEqual(command.getName(), "Cancel")) {
      Cancel();
    } else if (StringHelper.stringsEqual(command.getName(), "OnRemove")) {
      OnRemove();
    }
  }
 @Override
 public void Search() {
   if (getEntityStronglyTyped() != null) {
     super.Search();
   }
 }
 @Override
 protected void OnSelectedItemChanged() {
   super.OnSelectedItemChanged();
   UpdateActionAvailability();
 }