Views

Views in Codejig define how data is presented, interacted with, or exported. Each view type serves a unique purpose depending on the use case:

  1. Text View: Represents data as a concise string (e.g., "First Name Last Name"). Useful for search indexing and concise display. More info.

  2. Table View: Displays data collections in a table format. Developers control which fields are shown in columns and can include references to other data types. More info.

  3. Web Page View: Allows for user interaction through forms, supporting field editing, embedded types, and layout customizations in a user-friendly interface. More info.

  4. Spreadsheet View: Generates exportable spreadsheets based on predefined templates, ideal for reports or data analysis. More info.

  5. XML View: Exports data as XML, using templates and optional schema validation for structured document generation. More info.

  6. Word View: Uses Word templates to generate customizable Word documents. It is also used to create PDF documents. Supports tables, images, and formatting. More info.

  7. JSON View: Customizes how data is serialized into JSON format for APIs. Developers can choose fields, their order, names, and even how composite types are serialized based on their own JSON views. Multiple JSON views can be defined to suit various API formats. More info.

  8. List View: Invoked to display all instances of a data type. Developers can configure which table view to use or display a custom web page view. It allows for flexibility, such as displaying summaries like running totals or restricting visible instances based on specific criteria.

  9. Card View: Used to display a field of a composite type as a widget, typically within a collection. It is similar to a web page view but is designed for embedding in another page (e.g., showing products with images, prices, and a "Buy" button). Though embedded, it maintains its own life cycle and independent programming context.

Auto-Generated Views:

When a new data type is created, certain auto-generated views are created by default. These are marked with a gray line and an “Auto” badge. Developers can click on these auto-generated views to customize or redefine them as needed. This feature provides a starting point, allowing developers to quickly modify or extend views without starting from scratch.

Additional Notes:

  • Interactive Views: Web Page and Table views enable direct interaction, allowing data editing.
  • Export Views: Word, XML, and Spreadsheet views are used for exporting data.
  • Import/Export Views: JSON views allow both importing and exporting of data, ideal for APIs and integrations.

Developers can create multiple views for a single composite type, ensuring flexibility in how data is visualized or interacted with. Each view can be customized based on user roles, contexts, or output needs, allowing for a dynamic and responsive user experience.