Detail (value of embedded)

From JRapid

Jump to: navigation, search

detail is a value of embedded.

Other values are:


Contents

Description

When a property is declared as embedded detail (no matter if it is collection or single), the form of the child entity is completely embedded in the form of the parent entity.

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

Single example

  • Embedding as detail a "User" entity inside a "Seller" form:
    <entity label="Seller" menu="Sellers" name="Seller">
             <property embedded="detail entity="User" label="User" labelposition="top" name="user"
              required="required" unique="unique"/>
    </entity>
"embedded detail" example

Check out embedded for a single valued example.

Collection example

Business rules

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

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

    <entity label="Company" menu="Main" name="Company">
        <property display="primary" label="Name" name="name"/>
        <property embedded="detail" entity="Address" label="Address" name="address" labelposition="fieldset" collection="set" childproperty="company" extendable="extendable" />
    </entity>

    <entity label="Address" name="Address">
        <property entity="Company" label="Company" name="company"/>
        <property label="Street" name="street"/>
        <property label="Number" name="number"/>
        <property label="City" name="city"/>
    </entity>


  • We want to preserve the box layout for the address fields, so a embedded-form-disposition is a good way of getting this.
  • We will never have many rows (for many rows consider embeddedlisting).


Here we get the child entity with its form embedded for each row. Additionally, we get a remove-line button at the end.

See also

Most important wikiwords that appear in the article, and how they link, when needed

Personal tools