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

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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>
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    dlapointe created

    Thank you

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.