Open Closed

Extra Properties order and validation #1234


0
Leonardo.Willrich created
  • ABP Framework version: v4.3.0
  • UI type: Blazor
  • DB provider: EF Core

Hi,

I have created four new extra properties for the Entity Tenant. It is showing in the Create / Edit form when I am creating or editing a Tenant, however, the fields doesn't have a right sequence as I wish. How can I define the sequence for the fields?

Also, the integer field is not validated and the field is not limited to number, the user can type any character, which is not the right thing.

I've followed all topics/articles listed on this question: https://support.abp.io/QA/Questions/160/How-to-customize-an-ABP-project Also, I've checked this question: https://support.abp.io/QA/Questions/604/Add-Custom-Fields-to-Tenant-Entity-and-Tenant-Management-UI

None of them tells about the field order in the forms/grid.

Here is my definition for Extra Properties:

ObjectExtensionManager.Instance.Modules()
                  .ConfigureSaas(saas =>
                  {
                      saas.ConfigureTenant(tenant =>
                      {
                          tenant.AddOrUpdateProperty<string>("Address");
                          tenant.AddOrUpdateProperty<string>("Website", property => property.Attributes.Add(new UrlAttribute()));
                          tenant.AddOrUpdateProperty<bool>("EnableAvaTCMService", property => property.UI.OnTable.IsVisible = false);
                          tenant.AddOrUpdateProperty<int?>("AvaSiteId", property => property.UI.OnTable.IsVisible = false);
                      });
                  });

That is how the form looks like. It is important to mention that I saw that order changing when I compile the solution again:


9 Answer(s)
  • 0
    yekalkan created
    Support Team

    Hi,

    ExtensionProperties are always added to the bottom. There is not a way to order them.

    I think you need to override the related Blazor component. See docs: https://docs.abp.io/en/abp/latest/UI/Blazor/Customization-Overriding-Components

    You can download the source code of Volo.Saas module to see the component you want to override.

    TenantManagement.razor is the file you need.

  • 0
    Leonardo.Willrich created

    Hi yeakalkan,

    It is ok if they stay at the bottom, but, how can I create an order/sequence for the new 4 fields. Every time they are displayed in a different sequence. I don't mind if they stay on the bottom, so, I don't see any reason to extend TenantManagement.razor. I just need a property when configuring the extra properties to say the order for the create/edit form and the grid. There is no property for that.

    I haven't change the source code, see how it is displaying now:

  • 0
    Leonardo.Willrich created

    Hi, any progress on this question? Did I make myself clear? Does that make sense?

  • 0
    yekalkan created
    Support Team

    Hi,

    It seems like a potential bug/problem in ABP Framework. I've created an issue for this https://github.com/abpframework/abp/issues/8858

  • 0
    Leonardo.Willrich created

    Hi,

    The fix in the https://github.com/abpframework/abp/issues/8858 doesn't work for me. It is only listing the fields in an alphabetic order. It makes no sense. I need to define the fields order based on what makes sense for the user grouped by subject. The order now is stable, I mean, it will always show the fields in the same position, however, that is not what I want.

  • 0
    alper created
    Support Team

    how about ordering them in the UI ?

  • 0
    Leonardo.Willrich created

    Hi @Albert,

    What do you mean? I don't have in my project the Razor component/page for Tenant, I'm using extra properties to add more fields. However, it is showing in Alphabetic order, there is no way to define with order I want to show the fields.

  • 0
    yekalkan created
    Support Team

    Hi @Leonardo.Willrich,

    I'll review this PR again https://github.com/abpframework/abp/pull/8900

  • 0
    ServiceBot created
    Support Team

    This question has been automatically marked as stale because it has not had recent activity.