reversearray

Reverse Array Field

The reversearray form tool requires FarCry 4.1. It is not available in earlier versions of FarCry.

This form tool provides a way to add "reverse joins" to types. Instead of managing a field on the type itself, it manages the type's membership in the array properties of another object. An example is the permission roles property. Permissions are attached to a role through an array property in role, which generally means that role-permission relationships can only be managed from within the role. By adding a reversearray to permission, you give users the ability to manage that relationship from permission as well.

Until (or unless) non-persistent fields are implemented, properties using this formtool should simply be of type "string" and have the attribute bSave="false". While there is no harm in saving this field, it will not be updated when the related type is updated, and therefore will not be reliable.

This formtool is an adaption of the list formtool. As such it is only practical for situations where the set of potential related types is small. For example, there are rarely many roles in an application.

Attribute

Description

Default Value

ftJoin

Similar to the ftJoin attribute used by array and uuid. Specifies the type to join on.

required

ftJoinProperty

The array property to manage.

required

Sample Code

Sample Code Implementation
<cfproperty name="roles" 
 type="string" 
 default="" 
 hint="A meta-property for managing role-permission relationships" 
 ftSeq="2" 
 ftLabel="Roles" 
 ftType="reversejoin" 
 ftJoin="farRole"
 ftJoinProperty="permissions"
 bSave="1" />