Hurry Up, Ends March 14!
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
image.png

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 :
image.png

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

    image.png

  • User Avatar
    0
    dlapointe created

    Thank you

Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 13, 2025, 04:08