Listing

Listing is one of the central components in Logiak

What is a LISTING?

A Listing presents records of an Object type, one after the other, a row for each record.

Listing is a powerful Component because of the transitions you can define.

How to create a LISTING?

To create a LISTING, you have to first have defined an Object that you want to list.

In this video showing how to create a LISTING, we had defined an Object called “event”.

Creating an Events Listing

LISTING Transitions

LISTING has four transitions where you can add Components and extend the functionality of your App.

At their very basic, you might think of these transitions as supporting CRUD functionality (Create, Read, Update, Delete).

CRUD LISTING Transition Object is selected (downstream created)
Create ADD no - object is added, but not selected
Read SELECT yes
Update EDIT yes
Delete DELETE yes - delete transition selects an object for deletion

To create simple CRUD functionality for a Logiak App, it is sufficient to create a LISTING, and add a Component for each of these transitions.

Building a First App shows how to do this very quickly using auto-create.

1. SELECT transition

This is all about: what happens when the user click on an item in the list?

Simple read functionality

If you create an Object View for the same Object type which is being listed, and attach that as the SELECT transition of the list, a user would be able to click on an item in the list and view the data contained in the instance.

Beyond simple read functionality

However, you don’t need to limit the SELECT transition to an Object View.

The SELECT transition is important because the user selects an Object instance from the list,

The selection of an object creates a downstream within which Logiak remembers the object chosen and can pass it on to other Components.

You can define a whole sub-tree of Components in the Flow with the selected object in mind, to

  • show the data in the object
  • if the object has relationships, perhaps show a filtered list of related objects (e.g. invoices for a selected company)
  • offer the user a workflow of Actions all related to the chosen object

So, yes you can attach an Object View so that the user can look at the data, but you can instead attach a Container, such as a Tabs Component, and make the Object View one of the Tabs, while adding other Listings and Actions in other tabs..

2. ADD Transition

If you have a list, you may want the user to be able to add an item.

For example, if we have defined an event object, and we present the user with a list of events, you might want the user to be able to register a new event and it appear in the list.

We do that in Logiak by attaching a suitable component as the ADD Transition.

This usually means

  • defining a Process - an interactive dialogue - to elicit information from the User
  • wrapping the Process in a Process Component
  • attach the Process Component as the ADD transition

Setting a Component for ADD

3. EDIT Transition

A third functionality you may want to have is for a user to be able to edit the data in an instance, or at least the values of certain selected fields.

This can be done with an Object View, set to edit mode.

4. DELETE Transition

If you have a list, you may want the user to be able to delete an item.

For example, if we have defined an event object, and we present the user with a list of events, you might want the user to be able to delete any specific event from the list (and from the database).

We do that in Logiak by attaching a suitable component as the DELETE Transition.

This usually means

  • defining a Process - an interactive dialogue - to confirm the delete with the user, and to a delete instance update action
  • wrapping the Process in a Process Component
  • attach the Process Component as the DELETE transition

What can you do with a list?

You can

  • define filters to restrict which instances to display

  • define user filters which users can turn on and off

  • define what appears in each row by using a template

  • make what appears conditional on true/false fields of the Object listed

  • define custom layouts for rows

  • define custom layouts for rows which are adaptive to display width

  • define what component appears when the user selects an instance (clicks on a row)

  • define what component appears when the user decides to add an instance (clicks on the action button)

  • define what component appears when the user wants to edit an instance (long clicks on a row)

  • define what component appears when the user wants to delete an instance (swipes left on a row)

  • lists have a search control built-in

  • define sort fields and thereby display a sort control to the user

Formatting List Rows

Some basics to know about list rows:

  • Every row represents an Object instance .
  • Any of the values from within the Object can be shown to the user.
  • If the Object being listed has a relationship with another object, fields from the related object can also be available to be shown to the user.

There are two ways to define what gets shown for each row.

  • Using a template, and choosing fields to provide values for the template
  • Configuring your own custom layouts, which can also involve making the rows adapt to different display widths

TEMPLATE row formatting

Configuring list rows using Templates is the simpler and more limited of the two ways, and it is the one selected by default.

CUSTOM LAYOUT row formatting

Filtering what instances appear in the List

There are two kinds of filters you can define:

  • implicit filters
  • user-controlled filters (filters that the users can turn on and off)

When a LISTING is initially created, by default it displays ALL instances of the chosen object found in the database.

You can specify filters which constrain which instances are shown.

Implicit filters

Implicit filter: show only cities in China with a population > 10 million

User filters

User filters are configured almost exactly the same.

Instead of being implicitly applied to the Listing at all times, User Filters instead are represented by controls with which the user can turn them on and off.

The only difference in the configuration is that one is able to define a user-friendly label for each control.

User filter: show only cities with a population > 10 million

Sorting the List

Sorting is specified by selecting one or more fields from the listed object.

You specify a field order (for neted sorting) and a default direction of sort (ascending or descending) for each.

Whichever sort fields are defined here, they become available to the user via a dropdown on the list. Precisely, the display names associated with the fields appear in the drop-down. An arrow control permits the user to switch direction of sort.

Adding sort controls to a Listing

Scaling - is the List usable on a mobile device when there are thousands of records?

The LISTING component can deal with many thousands of records.

As an illustration, we downloaded the city Data, and defined a Table Object to be able to incorporate the data into a Project

The data contains 42,905 rows.

We created a LISTING component to present 42,905 rows (i.e. without any filter applied).

The number of instances is shown by the number in the bottom left-hand corner..

See also

Cards which functions a lot like Listing