Relatedentity Property Action

From JRapid

Jump to: navigation, search

Relatedentity actions associates the action to an entity.

Usage:

<property ...>
<action type="relatedentity" entity=ENTITY name=NAME  label="Discard" location=LOCATION />
</property>
  • entity: the name of the associated entity.
  • defaultset: the defaultset which will load the associated entity property values.
  • defaultsetparams: the defaulset parameters.

Example:

This example shows the use of a relatedentity action in a property.

 <property name="country" label="Country" entity="Country">
   <action label="Provinces" type="relatedentity" entity="Province" defaultset="newForCountry" defaultsetparams="country" />
 </property>
 <entity name="Province" label="Province">
   <defaultset name="newForCountry">
     <param name="country" entity="Country" />
   </defaultset>
   <property name="name" label="Name" display="primary" />
   <property name="country" label="Country" entity="Country" />   
 </entity>

A country property has a relatedentity action, which refers to a Province entity. Then, a new province entity will be created, with the preselected country property as a parameter.