Open Closed

Can not get the edited value of an extension property #309


User avatar
0
yuhang.ji@yftech-dl.com created
  • ABP Framework version: v3.0.4
  • UI type: MVC
  • Tiered (MVC) or Identity Server Seperated (Angular): no
  • Exception message and stack trace: N/A
  • Steps to reproduce the issue:

I defined an extension property Birth to the IdentityUser:

ObjectExtensionManager.Instance.Modules()
                .ConfigureIdentity(identity =>
                {
                    identity.ConfigureUser(user =>
                    {
                        user.AddOrUpdateProperty<DateTime?>( 
                            "Birth", 
                            property =>
                            {
                                property.UI.OnTable.IsVisible = false;
                                property.Attributes.Add(new DataTypeAttribute(DataType.Date));
                            }
                        );

                    });
                });

The birth property is optional so I give it DateTime? type.

The create form works well, and I can see the birth value is stored to the DB successfully:

However when I edit the user, I cannot see the birth value:


7 Answer(s)
  • User Avatar
    0
    yuhang.ji@yftech-dl.com created

    It seems it's related to the DateTime format.

    I found there is a warning in the browser console:

    The specified value "2020/7/18 0:00:00" does not conform to the required format, "yyyy-MM-dd".
    

    If I remove property.Attributes.Add(new DataTypeAttribute(DataType.Date));, value can be displayed, but with time part which I don't want.

  • User Avatar
    0
    alper created
    Support Team Director

    I'll try to reproduce and get back to you

  • User Avatar
    0
    yuhang.ji@yftech-dl.com created

    Guys, any news?

  • User Avatar
    0
    alper created
    Support Team Director

    hi yuhang.ji, sorry for my late response, I missed this question. did you manage to handle ?

  • User Avatar
    0
    yuhang.ji@yftech-dl.com created

    Nope, the issue still exists.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi yuhang.ji@yftech-dl.com

    Sorry for late, I will check it today.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    We will resolve this in 3.1. https://github.com/abpframework/abp/pull/5146

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