Open Closed

Abp-select not respecting 'nullable' field #3775


User avatar
0
dlapointe created
  • 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 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team 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 created

    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 created
    Support Team Fullstack Developer

  • User Avatar
    0
    dlapointe created

    Thank you

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