Autogenerated Complex objects

Overview

A complex object is a property that consists of other simple properties or complex objects. Sitefinity CMS automatically generates editors for the them, depending on their types.

Complex object

The following screenshot displays a complex object with two properties of types string and int:

complex-object

Nested complex objects

The following screenshot displays a complex object that has one property and another complex object, which in turn, has two properties:

multilevel-complex-object 

Table with complex objects

You can have a custom widget that displays multiple complex objects in a table view with the ability to add or remove more entries such as the following:

ComplexObjectsTable 

In the screenshot above every row from the table displays the properties of one complex object. You can achieve this by using the TableView attribute.
For more information see Customize autogenerated fields » TableView.

Display all properties

In cases when you have a lot of properties that cannot be displayed on one row, Sitefinity displays only the first 5 properties, you can edit the rest of the properties, by clicking Edit (Edit) in column MORE DETAILS. This will expand all the properties of the complex object in a new page.

You can control the number of columns displayed, using the TableView property.
For more information, see Customize autogenerated fields » TableView.

Display a nested complex object

If there is a complex object inside a complex object, you can edit its properties, by clicking Edit (Edit) in column INNER COMPLEX OBJECT. In case the inner complex object is in the detailed page of properties, there is a section Inner complex object that you can expand and view the properties.

Code sample

To insert a complex object, use the following code sample:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

Field validations