Inline (value of embedded)

From JRapid

(Redirected from Inline)
Jump to: navigation, search

inline is a value of embedded.

Other values are:


Contents

Description

When a property is declared as embedded inline (it must be a collection), the properties of the child entity are displayed as columns.

  • The property of the child specified as childproperty will not appear as a column.
  • Remove-line button will appear at the end of each line.
  • Depending of the type of collection (attribute of property) used, ordering buttons may appear next to the remove-line button.
  • Properties of the child entity shown as columns can be specified with displayproperties (attribute of property).

The displayproperties value is a comma separated list of the properties that should be used as columns. An extra set of properties may be specified separated by a semicolon from the fist group in order to create a "more" group. This adds one more column at the far right that provides a link that toggles the visibility of the extra properties.

Usage

<property
         name = NAME
         label = LABEL
         ...
         entity = ENTITY
         collection = COLLECTION
         embedded = (inline|detail|grid)
         childproperty = PROPERTY
         maxrows = ROWS
         minrows = ROWS
         listindex = LIST_INDEX
         listunique = LIST_UNIQUE
         setorder = SETORDER
         sort = SORT
         sortexpr = EXPR
         where = WHERE
         extendable = "extendable"
         sortable = "sortable"
         gridheader = "gridheader"
         gridvalue = "gridvalue" 
         displayproperties = PROPERTIES
         (foreach?, dynamicforeach?, ...)
</property>


Examples

  • Main Company entity and a child Contact entity.
  • Contacts belong only to one Company (n-1).

File:Inline (value of embedded) ex1 model.jpg

    <entity label="Company" menu="Main" name="Company">
        <property display="primary" label="Name" name="name"/>
        <property display="secondary" label="Contacts" name="contacts" entity="Contact" 
             collection="set" embedded="inline" childproperty="company" extendable="extendable"/>
    </entity>

    <entity label="Contact" name="Contact">
        <property entity="Company" label="Company" name="company"/>
        <property label="First Name" name="firstName"/>
        <property label="Last Name" name="lastName"/>
        <property label="Phone" name="phone"/>
    </entity>


  • We have few fields, so a column-disposition is a good way of presenting (for more columns see detail.
  • We will never have many rows (for many rows consider embeddedlisting).

File:Inline (value of embedded) ex1.jpg

Here we get the child entity with its properties displayed as columns. Additionally, we get a remove-line button at the end.


Another interesting feature for this type of collections is using the more columns. Note how the displayproperties attribute lists the properties to be shown as columns and specifies extra columns after a semicolon. These extra properties are shown in an extra column as you may see in the image below.

   <entity label="Company" menu="Menu" name="Company">
        <property display="primary" label="Name" name="name"/>
        <property childproperty="company" collection="set" 
            displayproperties="firstName,lastName,phone,email;mobile,comments" embedded="inline" 
            entity="Contact" extendable="extendable" label="Contacts" name="contacts"/>
    </entity>

    <entity label="Contact" menu="Menu" name="Contact">
        <property display="primary" label="First Name" name="firstName"/>
        <property display="primary" label="Last Name" name="lastName"/>
        <property display="secondary" entity="Company" label="Company" name="company"/>
        <property label="Phone" name="phone"/>
        <property label="Email" name="email"/>
        <property label="Mobile" name="mobile"/>
        <property label="Comments" name="comments" type="text"/>
    </entity>


File:more3.jpg

File:more2.jpg

See also

Personal tools