Basesubset (attribute of subset)

From JRapid

Jump to: navigation, search

basesubset is an attribute of subset.

Description

A basesubset attribute can be used to extend from another subset.

The subset used as basesubset cannot receive parameters. The new subset will inherit every condition and restriction present in the basesubset, but not the order or displayproperties.

Example

Suppose you have an entity with a boolean property named active that determines if a record show be shown at all in forms and listings. Instead of defining that condition in every subset you create for the entity you might define it once and then use that subset as base for the rest. In this way, if the condition changes in the future you only have to change your definition in one place.

    <entity label="Team" menu="Menu" name="Team">
        <subset name="forActiveTeams">
            <condition field="active" value="'true'"/>
        </subset>
        <subset basesubset="forActiveTeams" name="forArgentina">
            <condition field="country" value="'Argentina'"/>
        </subset>
        <subset basesubset="forActiveTeams" name="forBrazil">
            <condition field="country" value="'Brazil'"/>
        </subset>
        <property display="primary" label="Name" name="name"/>
        <property label="Country" name="country"/>
        <property label="Active" name="active" type="boolean"/>
    </entity>

See also

Personal tools