Purpose:
Generate the applicable data control for data element based on it’s content value from the CDD (ie: saved to the data base and not value on the web page) , dictionary settings and developer’s UX parameters.
Service Parameters (json array)
- serviceName (string) = “ccbUX”
- function (string) = “ccb_uxWebControl_v0.1”
Data Element Parameter (json array)
- The CDD name of the Data Element
Data Value Parameter (json array)
- If the allow_update parameter is set to True, provide value from the Pages’s POST values.
Key Parameters (json array)
Content Scope
Scope | Required Parameters | |
No content |
|
|
Client |
|
|
Specific Event |
|
Notes regarding Content Scope
- If the page has multiple forms, one of the following combinations are required: FollowupFormID or the unique_id parameters (see below) is required.
- To reduce the number of times cdd_getDataElements is called per page, for performance reasons, if the web page has more than one control based on the same data, it is preferable for the developer to call cdd_getDataElements once per page and pass the results as Data Parameter for each control.
- If Key Parameters are provided, the function uses cdd_getDataElements to retrieve the key value pairs of the data elements and sets the controls data value accordingly.
- If Key Parameters are not provided, the function does not set the value.
Data Values (json array)
- Key Value pairs of DataElements and it’s value.
UX Parameters (json array)
Parameter Name | Purpose | Type | Default | Options | Purpose |
allow_update | Allows update | Boolean | False | True | Creates a control that allows user input. |
return_oldest_value | Override the CCB’s default to return the most recent value. | Boolean | False | True | To return the first value of the element. |
code_lookup_type | To set the type of HTML control when the dataelement isCodeLookup = True | String | text | option | Option list |
String | select | Select list | |||
String | radio | radio button group | |||
String | buttonarea | ||||
String | checkbox | ||||
num_cols | If the code_lookup_type is set to a radio or checkbox, controls are horizontal. | Number | 1 | 2,3,4,… | Arranges the control horizontally. |
add_zero_row | Boolean | ||||
js_function | javascript | String | null | Custom java script | |
css_class | String | ||||
css_label | css_label | String | label_1 | Custom CSS | |
css_data | CSS name for the data portion of the control | String | data_1 | Custom CSS | |
css_style | Style for the control | String | null | Custom style | |
bold_label_ind | Boolean | ||||
label_type | Override label/data left to right | String | none | No label | |
other_label | Override the default Label_Med value in the dictionary | String | Custom label | ||
textarea_cols | Number | ||||
textarea_rows | Number | ||||
textarea_nl2lf | Boolean | ||||
in_widget_ind | overrides the default 600ox width of a text area | Boolean | False | True | Width=350 |
img_height | Number | ||||
is_id_name_unique | Handles web pages with more than 1 dataset and possible name collisions with javascript and jquery references to it’s ID and Name | Boolean | False | True | Provide an optional id_name (below) |
id_name | Overrides the default unique ID name | String |
Notes
Results (json array)
- Status (string). (“0″=Success, “1”=Not Successful)
- statusMessage (string) (“Empty”,”Results”)
- data (json array) (the results if not empty)
Example
Click here for an example.