I have try to use register to save value and call it in some place of UiComponent such as ButtonProvider or Field OptionSource but seem it doesn't work. Is that a right way to do it or i am doing wrong
In controller i save variable to register


In another place i get data by registry


1 Answer 1


I found solution for my question. Use Persistor instead of registry. Some case you need to pass data to Component area such as : Form. You can use Persistor to get this data instead use registry. Registry usually use in Controllers or Models

use Magento\Framework\App\Request\DataPersistorInterface;

 * @var DataPersistorInterface
protected $dataPersistor;

public function __construct(
    DataPersistorInterface $dataPersistor
    $this->dataPersistor = $dataPersistor;

protected function saveDataToPersistor() {
 $this->dataPersistor->set('val', $value);

To get data in persistor use get method

  • Any chance you could show how you retrieved the information in you ui-component xml ?
    – Frank
    Commented Nov 1, 2016 at 19:06
  • Dataprovider define in xml form responsible to retrieve and populate data.
    – mrtuvn
    Commented Nov 2, 2016 at 1:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.