protected function validateWidget($widget, $value)
    {
        if (null === $value) {
            return;
        }
        $widget->setInputCallback(function () use ($value) {
            return $value;
        });
        $widget->validate();
    }