Starts in:
2 DAYS
11 HRS
3 MIN
53 SEC
Starts in:
2 D
11 H
3 M
53 S
Open Closed

Add item to list when not found for SELECT list in role=combobox mode with select2 and ABP SUITE #5882


User avatar
0
rwright-ruhealth created
  • ABP Framework version: v7.3.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Tiered MVC
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I would like to have the drop down (multi-select) in MVC prompt the user when an item is not found in the list. Behind the scenes, the MVC razor select is rendered using select2 library and it creates a select2 role="combobox" list control. How to add an item to the list and database if not found in list with out exiting the modal dialog? Can you point me to some code that is tried and proven? I am sure this is a recurring issue for many. I use ABP suite to generate the basic shell for my items and then heavily modify from there. ABP suite is not usable after making custom mods as it wipes them out in version 7.3.2.

Thank you.


3 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello rwright-ruhealth,

    could you please check this link https://learn.microsoft.com/en-us/answers/questions/1246334/drop-down-in-razor-that-can-let-you-type-the-value?page=1

    Here instead of controller you need to add code in code behind i.e. *.cshtml.cs or Model.

    please do let me know if it helps you

    Thank you, Anjali

  • User Avatar
    0
    rwright-ruhealth created

    Hello rwright-ruhealth,

    could you please check this link https://learn.microsoft.com/en-us/answers/questions/1246334/drop-down-in-razor-that-can-let-you-type-the-value?page=1

    Here instead of controller you need to add code in code behind i.e. *.cshtml.cs or Model.

    please do let me know if it helps you

    Thank you, Anjali

    Good day; I did something similar after researching documentation using the select2 combo and razor pages. The problem I ran into is my custom code gets clobbered by ABP suite when I regenerate the page. I was thinking there must be an ABP way to do it that I wasn't aware of. Now that I upgraded to version 7.4 rc5 I am going to try again using the custom code blocks comment tags to see if I can keep my changes. I figured out some of the tricks to working with the custom code blocks so far. See my write up in this support question. [Question #5892](https://support.abp.io/QA/Questions/5892/14629-THE-custom-code-tag-suite-custom-code-block-n-is-ignored-by-ABP-Suite-Custom-code-is-wiped-out)

  • User Avatar
    0
    alper created
    Support Team Director

    Suite comes with a new feature with 7.4 It will keep your custom code after regenerating your entity again. https://blog.abp.io/abp/ABP.IO-Platform-7-4-RC-Has-Been-Published


    there's not a formal way of adding a not existing item to the select2 component by ABP. It's a custom business logic. You can add a new button to enable users add new items. But this has nothing to do with ABP.

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