Otvoriť Uzavreté

Abp-select not respecting 'nullable' field #3775


User avatar
0
dlapointe vytvorené
  • ABP Framework version: 6.0.0-rc.4
  • UI type:MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Hi,

The <abp-select> should be adding an empty SelectListItem if the field is not required (as per the doc) but it doesnt

Here is the viewmodel, you can see that TechnicianId is nullable

public class AssignInfoViewModel
    {
        [Required]
        public Guid Id { get; set; }
        [Required]
        public Guid InstrumentId { get; set; }
        public Guid? TechnicianId { get; set; }
        [Required]
        public int Duration { get; set; }
    }

Here is the view : <abp-select asp-for="Info.TechnicianId" asp-items="Model.TechnicianLookupListRequired" label="@L["Technician"].Value" />

And here is the output, as you can see, there is no empty options so the user 'have' to select something even tough its a nullable property :

Thank you


4 odpoveď(e)/dí
  • User Avatar
    0
    maliming vytvorené
    Tím podpory Fullstack Developer

    hi

    I will check this, You can add an option now.

    <abp-select asp-for="Info.TechnicianId" asp-items="Model.TechnicianLookupListRequired" label="@L["Technician"].Value" >
        <option value="">Choose a Technician</option>
    </abp-select>
    
  • User Avatar
    0
    dlapointe vytvorené

    Ok thanks, ill add it.

    Just to be sure i understand correctly, if the issue we do submit is marked as an actual bug and not a wrong config / usage, we get our 'credit' back, right?

  • User Avatar
    0
    maliming vytvorené
    Tím podpory Fullstack Developer

  • User Avatar
    0
    dlapointe vytvorené

    Thank you

Made with ❤️ on ABP v8.2.0-preview Updated on marca 25, 2024, 15:11