jFormsControlChoice
extends jFormsControlGroups
in package
choice control.
It has a list of choices, called choice items. Each item has a value and a list of child controls. The value of the choice control is the value of the selected item.
$this->container->privateData contain the list of items that are deactivated. A deactivated item is not displayed.
Tags
Table of Contents
- $alertInvalid : string
- $alertRequired : string
- $datatype : jDatatype
- $defaultValue : mixed
- $emptyValueLabel : string
- $help : string
- $hint : string
- $initialActivation : bool
- $initialReadOnly : bool
- $items : mixed
- list of item. Each value is an array which contains corresponding controls of the item an item could not have controls, in this case its value is an empty array.
- $itemsNames : mixed
- $label : string
- $ref : string
- $required : bool
- $type : string
- $attributes : array<string|int, mixed>
- $childControls : mixed
- all child controls of the group.
- $container : jFormsDataContainer
- $form : jFormsBase
- __construct() : mixed
- addChildControl() : mixed
- check() : null|int
- check and filter the value of the control.
- createItem() : mixed
- deactivate() : mixed
- deactivateItem() : mixed
- getAttribute() : mixed
- getChildControls() : mixed
- getDisplayValue() : mixed
- getWidgetType() : string
- isActivated() : bool
- check if the control is activated.
- isContainer() : mixed
- says if the control can have multiple values.
- isHtmlContent() : mixed
- says if the content is html or not.
- isItemActivated() : mixed
- isModified() : mixed
- isReadOnly() : bool
- check if the control is readonly.
- setAttribute() : mixed
- setData() : mixed
- setDataFromDao() : mixed
- setForm() : mixed
- setReadOnly() : mixed
- setValueFromRequest() : mixed
- _diffValues() : bool
Properties
$alertInvalid
public
string
$alertInvalid
= ''
the message when the value is invalid
Tags
$alertRequired
public
string
$alertRequired
= ''
the message when there is no value and it is required
Tags
$datatype
public
jDatatype
$datatype
the object that manage constraints on the value
Tags
$defaultValue
public
mixed
$defaultValue
= ''
the value when the form is created (and not initialized by a data source
Tags
$emptyValueLabel
public
string
$emptyValueLabel
label displayed when only values are displayed, and when there is no value
Tags
$help
public
string
$help
= ''
the message for the help on the control (typically help displayed in a popup)
Tags
$hint
public
string
$hint
= ''
the message for tips on the control (typically the tooltip value)
Tags
$initialActivation
public
bool
$initialActivation
= \true
Tags
$initialReadOnly
public
bool
$initialReadOnly
= \false
indicate if the control is in read only mode
Tags
$items
list of item. Each value is an array which contains corresponding controls of the item an item could not have controls, in this case its value is an empty array.
public
mixed
$items
= array()
Tags
$itemsNames
public
mixed
$itemsNames
= array()
Tags
$label
public
string
$label
= ''
the label
Tags
$ref
public
string
$ref
= ''
the identifiant of the control
Tags
$required
public
bool
$required
= \false
true if the control should be filled by the user
Tags
$type
public
string
$type
= 'choice'
a type name that identify the control type
Tags
$attributes
protected
array<string|int, mixed>
$attributes
= array()
miscellaneous values attached to the control
Tags
$childControls
all child controls of the group.
protected
mixed
$childControls
= array()
Tags
$container
protected
jFormsDataContainer
$container
content all values of the form
Tags
$form
protected
jFormsBase
$form
the form object
Tags
Methods
__construct()
public
__construct(string $ref) : mixed
Parameters
- $ref : string
-
the identifiant of the control
Tags
Return values
mixed —addChildControl()
public
addChildControl(mixed $control[, mixed $itemValue = '' ]) : mixed
Parameters
- $control : mixed
- $itemValue : mixed = ''
Tags
Return values
mixed —check()
check and filter the value of the control.
public
check() : null|int
It is the responsability of the implementation to fill the "errors" or "data" properties of the container.
Tags
Return values
null|int —null if it is ok, or one of jForms::ERRDATA_* constants when there is an error
createItem()
public
createItem(mixed $value, mixed $label) : mixed
Parameters
- $value : mixed
- $label : mixed
Tags
Return values
mixed —deactivate()
public
deactivate([mixed $deactivation = true ]) : mixed
Parameters
- $deactivation : mixed = true
Tags
Return values
mixed —deactivateItem()
public
deactivateItem(mixed $value[, mixed $deactivation = true ]) : mixed
Parameters
- $value : mixed
- $deactivation : mixed = true
Tags
Return values
mixed —getAttribute()
public
getAttribute(mixed $name) : mixed
Parameters
- $name : mixed
Tags
Return values
mixed —getChildControls()
public
getChildControls() : mixed
Tags
Return values
mixed —getDisplayValue()
public
getDisplayValue(mixed $value) : mixed
Parameters
- $value : mixed
Tags
Return values
mixed —getWidgetType()
public
getWidgetType() : string
Tags
Return values
string —the default widget type to use to render the control
isActivated()
check if the control is activated.
public
isActivated() : bool
Tags
Return values
bool —true if it is activated
isContainer()
says if the control can have multiple values.
public
isContainer() : mixed
Tags
Return values
mixed —isHtmlContent()
says if the content is html or not.
public
isHtmlContent() : mixed
Tags
Return values
mixed —isItemActivated()
public
isItemActivated(mixed $value) : mixed
Parameters
- $value : mixed
Tags
Return values
mixed —isModified()
public
isModified() : mixed
Tags
Return values
mixed —isReadOnly()
check if the control is readonly.
public
isReadOnly() : bool
Tags
Return values
bool —true if it is readonly
setAttribute()
public
setAttribute(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
Tags
Return values
mixed —setData()
public
setData(mixed $value) : mixed
Parameters
- $value : mixed
Tags
Return values
mixed —setDataFromDao()
public
setDataFromDao(mixed $value, mixed $daoDatatype) : mixed
Parameters
- $value : mixed
- $daoDatatype : mixed
Tags
Return values
mixed —setForm()
public
setForm(jFormsBase $form) : mixed
Parameters
- $form : jFormsBase
Tags
Return values
mixed —setReadOnly()
public
setReadOnly([mixed $r = true ]) : mixed
Parameters
- $r : mixed = true
Tags
Return values
mixed —setValueFromRequest()
public
setValueFromRequest(mixed $request) : mixed
Parameters
- $request : mixed
Tags
Return values
mixed —_diffValues()
protected
_diffValues(mixed &$v1, mixed &$v2) : bool
Parameters
- $v1 : mixed
- $v2 : mixed
Tags
Return values
bool —true if the values are not equals