General Chooser Property Component

From ADF Docs
Jump to: navigation, search

Overview

General Chooser Property Component is a component to build the data set and customize rendering for the field.

The General Chooser Property Component is extended to the ADF General Chooser component (/ADF/extensions/customfields/general_chooser/general_chooser.cfc) and contains the functions for the base rendering. By implementing this extension, we can defined a set of variables specific to the data set for the custom element to select.

Follow the instructions below to setup a simple Property Component.


Instructions

  1. Copy the Sample_GC component from the ADF extensions general chooser directory (/ADF/extensions/customfields/general_chooser/general_chooser/sample_gc.cfc).
  2. Paste the sample into your local sites CS Apps components directory (/mysite/_cs_apps/components/). If the components directory does not exist, then create it.
  3. Rename the component file from "sample_GC.cfc" to the specific custom element that you are selecting. (For example, with the Profile application a property component is named "profileGC.cfc" to select Profile custom element records.) You will want to be able to recognize the custom element data for the property component by reading the name (don't make this harder on yourself than it needs to be here).
  4. Open the property component in an editor.
  5. In the first set of variables with the comment CUSTOM ELEMENT INFO, define the following variables that are specific to your custom element:
    1. variables.CUSTOM_ELEMENT - The name of the custom element to select the records.
    2. variables.CE_FIELD - The field name in the custom element that is a unique value for each record. (Note: Best practice is to use a UUID field in the custom field.)
    3. variables.SEARCH_FIELDS - A comma separated list of the field names in the custom element that will be searched to filter available selections.
    4. variables.ORDER_FIELD - The field name in the custom element to sort the available selections for rendering.
  6. Save the property component.
  7. Add an entry into the site's Proxy White List.
  8. Reset the ADF.