:)
It works for me:
[ControllerName("JournalVoucherLine")]
[Route("api/mainAccounting/JournalVoucherLine")]
public class JournalVoucherLineController : AbpController
{
[HttpGet]
[Route("getAccountLookup")]
public async Task<PagedResultDto<AccountResultDto>> GetAsync()
{
return new PagedResultDto<AccountResultDto>(2, new List<AccountResultDto>
{
new AccountResultDto() { DisplayName = "Test", Id = Guid.NewGuid() },
new AccountResultDto() { DisplayName = "Test2", Id = Guid.NewGuid() }
});
}
}
public class AccountResultDto
{
public string DisplayName { get; set; }
public Guid Id { get; set; }
}
<select asp-for="Account.AccountId"
class="auto-complete-select"
data-autocomplete-api-url="/api/mainAccounting/JournalVoucherLine/GetAccountLookup"
data-autocomplete-display-property="displayName"
data-autocomplete-value-property="id"
data-autocomplete-items-property="items"
data-autocomplete-filter-param-name="filter"
data-autocomplete-allow-clear="true">
</select>
<select asp-for="Account.AccountId"
class="auto-complete-select"
data-autocomplete-api-url="/api/mainAccounting/JournalVoucherLine/GetAccountLookup"
data-autocomplete-display-property="displayName"
data-autocomplete-value-property="id"
data-autocomplete-items-property="items"
data-autocomplete-filter-param-name="filter"
data-autocomplete-allow-clear="true">
</select>
data-autocomplete-display-property is the displayName not items.displayNamedata-autocomplete-value-property is the id not items.iddata-autocomplete-items-property is the itemsHi,
ABP and ASP.NETCore does not have a solution for this scenario, you can check the discussion here https://stackoverflow.com/questions/62263805/asp-net-core-3-1-web-api-authorization-on-model-property-level
Hi,
It's a problem, we will fix it in the next RC version
You can check the document
https://docs.abp.io/en/commercial/latest/startup-templates/microservice/interservice-communication
I can only give this advice because I don't know the details of your project. Thanks for your understand.
You can refer to the ABP code https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml#L42-L45
https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs#L64
Hi,
Try:
<select asp-for="Account.AccountId"
class-"auto-complete-select"
data-autocomplete-api-url="/api/mainAccounting/JournalVoucherLine/GetAccountLookup"
data-autocomplete-display-property="accountName"
data-autocomplete-value-property="accountId"
data-autocomplete-items-property="accounts"
data-autocomplete-filter-param-name="filter"
data-autocomplete-allow-clear="true">
</select>
Make sure the /api/mainAccounting/JournalVoucherLine/GetAccountLookup endpoint return result is correct