Open Closed

How to concatenate 2 fields in a select #1603


User avatar
0
samuelhelou created

Hi guys, I'm starting now and I have basic doubts, but I already racked my brain and couldn't.

How to concatenate 2 fields in a select, do I do this in Backend or Frontend? Where exactly could I do it?

I've been to these 4 places, but I don't know exactly where to move and what to do

 <div class="col-12 col-sm-auto">
              <div class="form-group">
                <label for="contaTipoIdFilter">
                  {{ '::ContaTipo' | abpLocalization }}
                </label>
                <abp-lookup-select
                  cid="contaTipoIdFilter"
                  [getFn]="service.getContaTipoLookup"
                  [(ngModel)]="filters.contaTipoId"
                  [ngModelOptions]="{ standalone: true }"
                ></abp-lookup-select>
              </div>
            </div>
public virtual async Task<PagedResultDto<ContaWithNavigationPropertiesDto>> GetListAsync(GetContasInput input)
        {
            var totalCount = await _contaRepository.GetCountAsync(input.FilterText, input.Agencia, input.ContaNumero, input.ContaDV, input.Descricao, input.Usuario, input.Senha, input.SenhaAprovacao, input.Titular, input.CPF, input.BancoId, input.ContaTipoId);
            var items = await _contaRepository.GetListWithNavigationPropertiesAsync(input.FilterText, input.Agencia, input.ContaNumero, input.ContaDV, input.Descricao, input.Usuario, input.Senha, input.SenhaAprovacao, input.Titular, input.CPF, input.BancoId, input.ContaTipoId, input.Sorting, input.MaxResultCount, input.SkipCount);

            return new PagedResultDto<ContaWithNavigationPropertiesDto>
            {
                TotalCount = totalCount,
                Items = ObjectMapper.Map<List<ContaWithNavigationProperties>, List<ContaWithNavigationPropertiesDto>>(items)
            };
        }
 "GetBancoLookupAsyncByInput": {
              "uniqueName": "GetBancoLookupAsyncByInput",
              "name": "GetBancoLookupAsync",
              "httpMethod": "GET",
              "url": "api/app/contas/banco-lookup",
              "supportedVersions": [],
              "parametersOnMethod": [
                {
                  "name": "input",
                  "typeAsString": "Freedom.Shared.LookupRequestDto, Freedom.Application.Contracts",
                  "type": "Freedom.Shared.LookupRequestDto",
                  "typeSimple": "Freedom.Shared.LookupRequestDto",
                  "isOptional": false,
                  "defaultValue": null
                }
              ],
              "parameters": [
                {
                  "nameOnMethod": "input",
                  "name": "Filter",
                  "jsonName": null,
                  "type": "System.String",
                  "typeSimple": "string",
                  "isOptional": false,
                  "defaultValue": null,
                  "constraintTypes": null,
                  "bindingSourceId": "ModelBinding",
                  "descriptorName": "input"
                },
                {
                  "nameOnMethod": "input",
                  "name": "SkipCount",
                  "jsonName": null,
                  "type": "System.Int32",
                  "typeSimple": "number",
                  "isOptional": false,
                  "defaultValue": null,
                  "constraintTypes": null,
                  "bindingSourceId": "ModelBinding",
                  "descriptorName": "input"
                },
                {
                  "nameOnMethod": "input",
                  "name": "MaxResultCount",
                  "jsonName": null,
                  "type": "System.Int32",
                  "typeSimple": "number",
                  "isOptional": false,
                  "defaultValue": null,
                  "constraintTypes": null,
                  "bindingSourceId": "ModelBinding",
                  "descriptorName": "input"
                }
              ],
              "returnValue": {
                "type": "Volo.Abp.Application.Dtos.PagedResultDto<Freedom.Shared.LookupDto<System.Guid?>>",
                "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto<Freedom.Shared.LookupDto<string?>>"
              }
            },
  getContaTipoLookup = (input: LookupRequestDto) =>
    this.restService.request<any, PagedResultDto<LookupDto<string>>>({
      method: 'GET',
      url: '/api/app/contas/conta-tipo-lookup',
      params: { filter: input.filter, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
    },
    { apiName: this.apiName });

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v4.3.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: vX.X.X
  • UI type: Angular / MVC / Blazor
  • DB provider: EF Core / MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

2 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    are the 2 fields coming from backend?

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07