Keynote
- Plugin Properties Options allow a plugin to gather configuration data from the plugin user.
- Plugin Properties Options should be returned in the abstract method "getPropertyOptions" of each plugin.
- Plugin Properties Options are in JSON format.
Basic Properties Options Structure
[
{
title : 'Page Title',
properties : [
{
name : 'Property Name',
label : 'Property Label',
type : 'Property Type',
required : 'Mandatory or Not',
//… more property attributes …
}, //… more properties …
],
validators : [
//… properties custom validators …
]
}, //… more properties page …
]
Properties Option Types
- Hidden field - hidden
- Read only field – readonly
- Text field – textfield
- Password field – password
- Text area field – textarea
- HTML editor field – htmleditor
- Checkbox field – checkbox
- Radio button field – radio
- Select box field – selectbox
- Multi select box field – multiselect
- Element (Plugin) select field – elementselect
- Grid field - grid
Properties Validator Types
- AJAX - ajax
Detail Attributes of Option Types
Common Attributes for All Properties Options Types Except Hidden Field and Grid
{
name : 'Property Name',
label : 'Property Label',
description : 'Property Description', //optional, default is NULL
type : 'readonly',
value : 'Property Value', //optional , default is empty string
required : 'true', //optional, boolean value, default is false
}
Extra Attributes for Text Field, Password Field, Text Area and HTML Editor
{
size : '50', //optional , integer value, default is NULL, only for text field and password field
maxlength : '50', //optional, integer value, default is NULL, only for text field and password field
rows : '50', //optional, integer value, default is NULL, only for text area and html editor
cols : '50', //optional, integer value, default is NULL , only for text area and html editor
regex_validation : '^[a-zA-Z0-9_|a-zA-Z0-9_]
+$', //optional, default is NULL
validation_message : 'Error!!' //optional, default is NULL
}
Extra Attributes for Checkbox, Radio Button, Select Box and Multi Select Box, Element Select Field
{
size : '<span style="color: #0000ff">10</span>', <span style="color: #99cc00">//optional, integer value, default is 4,</span> <span style="color: #008000">only for multi select box</span>
options : [<span style="color: #99cc00">//is optional to use this attribute or options_ajax</span>
Unknown macro: {value},
Unknown macro: {value},
Unknown macro: {value}],
options_ajax_on_change : '<span style="color: #0000ff">property1</span>', <span style="color: #99cc00">//optional, value of this property name will passed over to load options from ajax</span>
options_ajax : '<span style="color: #0000ff">URL to load options JSON</span>' <span style="color: #99cc00">//optional, URL return JSON Array of a set of Objects that have value & label attribute</span>
}
Attributes for Hidden Field
{
name : 'Property Name',
type : 'hidden',
value : 'Property Value'
}
Attributes for Grid
{
name : 'Property Name',
label : 'Property Label',
description : 'Property Description', //optional, default is NULL
type : 'grid',
columns : [// 2 type of column, with and without options attribute
{key : 'col1', label : 'Col 1'},
{key : 'col2', label : 'Col 2',
options :[
{value :'option1', label : 'Option 1'},
{value :'option2', label : 'Option 2'}
]
},
]
value : [//optional, default is NULL
Unknown macro: {col1 },
Unknown macro: {col1 }],
required : 'true', //optional, boolean value, default is false
}
Extra Attributes for Element Select Field
{
options_ajax_on_change : 'property1', //optional, value of this property name will passover to load options from ajax
options_ajax : '[CONTEXT_PATH]
/web/property/json/getElements?classname= org.joget.apps.form.model.FormLoadElementBinder', //Load plugin list based on class name given
url : '[CONTEXT_PATH]
/web/property/json[APP_PATH]
/getPropertyOptions', //Load plugin properties
keep_value_on_change : 'true' //optional, boolean value, default is false. To keep current configuration for the next selected element
}
Detail Attributes of Validator Type
Attributes for AJAX
{
type : 'ajax',
url : 'URL to validate properties page value' , // All properties in the same page will send to this url to validate, URL return a JSON Object with status (success or fail) & message (JSONArray of String) attribute
default_error_message : 'Error in this page!!' //optional, default is null
}