General Chooser Property Component
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.
- Copy the Sample_GC component from the ADF extensions general chooser directory (/ADF/extensions/customfields/general_chooser/general_chooser/sample_gc.cfc).
- 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.
- 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).
- Open the property component in an editor.
- In the first set of variables with the comment CUSTOM ELEMENT INFO, define the following variables that are specific to your custom element:
- variables.CUSTOM_ELEMENT - The name of the custom element to select the records.
- 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.)
- variables.SEARCH_FIELDS - A comma separated list of the field names in the custom element that will be searched to filter available selections.
- variables.ORDER_FIELD - The field name in the custom element to sort the available selections for rendering.
- Save the property component.
- Add an entry into the site's Proxy White List.
- Reset the ADF.