Listing (element child of entity)

From JRapid

(Redirected from Listing (element))
Jump to: navigation, search

listing is an element, child of entity.


Contents

Description

Listings are used for showing the existing database records for an entity.


Every entity generates a default listing and may create as many custom listings as needed. A listing may define the columns, filters, actions and actiongroups to be shown, the view and subset used, and some more details described below.

Listings are composed visually by three sections: filters, view and actionbar.

Listing with layout left
  • filters section contains all the specified filters, and is by default placed on top of the view.
  • view section displays results in a certain way. The default view is called 'table', where results are shown as a table, with the defined properties as columns. Each row is a valid result of the query.
  • actionbar section includes paging toolbar, custom actions and system default actions (Add and Remove actions).


Both the filters and the actionbar sections modify the results shown in the view. They define user parameters that restrict the query. These parameters could be filter values, a page selection (e.g., results from the 51st to the 100th) or just the addition or removal of a record.

The layout attribute indicates how to display filters in a listing. It modifies the position of the elements of a listing (filters on top, listings below; filters on the left, listings on the right).

The view attribute is used to set the way the records should be listed. This attribute may take one of these built in values: table (default), basic or thumbnails. It may also use views created by the developer or imported from the JRapid Community. Defining a new listing view is done by replacing the view section with a custom one, where results are presented in a specific way.

The subset attribute indicates a subset element to be used for showing only those records that fulfill a specified criterion, to define the properties for each record that must be retrieved from the database or to change the order of the resulting records.

Listing elements may define tab elements as children. This creates tabs for different view sections in a listing.

A displayproperties attribute may be used to define the properties that will be displayed in the listing, such as the columns in a table view.

The displayfilters attribute defines which of the defined filters for the entity should be displayed in this listing.

The displayactions attribute defines which of the defined actions for the entity should be displayed in this listing.

The displayactiongroups attribute defines which of the defined actiongroups for the entity should be displayed in this listing.

The mainaction attribute overrides the default behavior on each view to open the record (in view 'table', the double-click, in 'basic' the single click, etc).


The noadd and noremove attributes define if the Add and Remove buttons should be shown in the listing, respectively.

See the defaultlisting attribute of entity to learn how to change the default listing.



Usage

<entity ...
   <listing
          name = NAME
          layout = "simple" | "left"
          view = COMMA_SEPARATED_VIEWS
          subset = SUBSET
          displayproperties = COMMA_SEPARATED_PROPERTIES
          displayfilters = COMMA_SEPARATED_FILTERS
          displayactions = COMMA_SEPARATED_ACTIONS
          displayactiongroups = COMMA_SEPARATED_ACTIONGROUPS
          mainaction = ACTION_NAME
          noadd = "noadd"
          noremove = "noremove" >

          [ Contents: tab* ]
          
   </listing>
</entity>

Example

This simple example makes use of several possible tweaks for listings. Note the custom listing companyListing that uses the forCompanyListing subset to change the properties that should be displayed.

Two filters, by name and active, are created, and an extra action is defined.

    <entity label="Company" menu="People" name="Company">
        <subset displayproperties="name,city,active" name="forCompanyListing"/>

        <listing displayproperties="name,city,active" layout="simple" name="companyListing" subset="forCompanyListing"/>

        <filter display="primary" label="Name" name="filterName" property="name"/>
        <filter display="primary" label="Active" name="filterActive" property="active"/>

        <property display="primary" label="Name" name="name"/>
        <property label="Address" name="address" type="text"/>
        <property label="City" name="city"/>
        <property display="secondary" label="Active" name="active" type="boolean"/>

        <action function="doSomehtingFunc" label="Do Something" location="button" name="doSomething" type="javascript"/>
    </entity>


When you open the companyListing this is what you get.


Companies listing

See also

Personal tools