Display (attribute of property)

From JRapid

Jump to: navigation, search

display is an attribute of property.


Contents

Description

The display attribute specifies where and how properties of an entity are to be shown. This attribute affects default listings, embeddedlistings, combo properties and entity-type properties. It may take values primary or secondary.


Display primary properties are:

  • Shown as columns in default listings
  • Shown as columns in embeddedlistings
  • Shown as second level data in combo widget properties
  • Shown as part of value in entity-type properties

Display secondary properties are:

  • Shown as columns in default listings
  • Shown as third level data in combo widget properties

Properties that do not specify a display attribute value are not shown in listings or other places where the entity is referred by default. Remember this may be changed as well through the use of listings with subset and the displayproperties attribute.

Usage

<property
   name = NAME
   label = LABEL
   display= "primary" | "secondary"
   ...
/>


Example

This simple example shows some differences between primary and secondary displayed properties.

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

    <entity label="Person" menu="Menu" name="Person">
        <property display="primary" label="First Name" name="firstName"/>
        <property display="primary" label="Last Name" name="lastName"/>
        <property label="Active" name="active" type="boolean"/>
        <property display="secondary" entity="Company" label="Company" name="company"/>
    </entity>

Note how for each entity some properties are defined with display attribute set to primary or secondary value.

  • Company:
    • Name is primary
    • City is secondary
    • Active is secondary
  • Person
    • firstName is primary
    • secondName is primary
    • Company is secondary

The resulting default listing and form look like this.

Display attribute example


name, city and active are shown in the Company listing.

firstName, secondName and company are shown in the Person entity.

Only the company name property is shown for the values of the company property on the Person form.


In the following example, the "display" attribute for "status" property is set to "secondary". It is is displayed in the listing of companies but it is not in the embedded listing of the "Seller" entity.

<entity label="Company" menu="Company" name="Company">
        <property display="primary" label="Name" name="name" required="required" />
        <property comboproperty="surname" entity="Seller" label="Responsable" name="responsable" />
        <property display="secondary" entity="CompanyStatus" label="Status" name="status" />
</entity>

<entity label="Seller" menu="Sellers" name="Seller">
        ...  
        <tab label="Companies" name="companies">
            <embeddedlisting entity="Company" label="Companies" listing="companiesListing" name="companies"
            subset="forSeller" subsetparams="."/>
        </tab>
        ...
</entity>
  • "status" property with display "secondary" is displayed in the entity's listing:
display "primary"
  • "status" property with display "secondary" is not displayed in embedded listings:
display "secondary"

See also

Personal tools