* - array $config['dropdowninput'] Configuration for the DropdownInputWidget
* - bool $config['or'] Configuration for whether the widget is dropdown AND input
* or dropdown OR input
+ * - bool $config['required'] Configuration for whether the widget is a required input.
*/
public function __construct( array $config = [] ) {
// Configuration initialization
[
'textinput' => [],
'dropdowninput' => [],
- 'or' => false
+ 'or' => false,
+ 'required' => false,
],
$config
);
$config['dropdowninput']['disabled'] = true;
}
+ $config['textinput']['required'] = $config['or'] ? false : $config['required'];
+ $config['dropdowninput']['required'] = $config['required'];
+
parent::__construct( $config );
// Properties
$config['dropdowninput'] = $this->config['dropdowninput'];
$config['dropdowninput']['dropdown']['$overlay'] = true;
$config['or'] = $this->config['or'];
+ $config['required'] = $this->config['required'];
return parent::getConfig( $config );
}
}