0
<field name="agent" sortOrder="170" >
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object"></item>
        <item name="config" xsi:type="array">
        <item name="label" xsi:type="string" translate="true">Module</item>
        <item name="visible" xsi:type="boolean">true</item>
        <item name="dataType" xsi:type="string">number</item>
        <item name="formElement" xsi:type="string">select</item>
        <item name="source" xsi:type="string">Test</item>
        <item name="dataScope" xsi:type="string">Module</item>
    </item>
</argument>
</field>
1

Check Cms module example. Your options tag object is empty. Add class following way:


<item name="options" xsi:type="object">Magento\Cms\Model\Page\Source\PageLayout</item>

And check here how create class as an example. Add your option class inside toOptionArray method. Ex:


/**
 * Get options
 *
 * @return array
 */
public function toOptionArray()
{
    if ($this->options !== null) {
        return $this->options;
    }

    $configOptions = $this->pageLayoutBuilder->getPageLayoutsConfig()->getOptions();
    $options = [];
    foreach ($configOptions as $key => $value) {
        $options[] = [
            'label' => $value,
            'value' => $key,
        ];
    }
    $this->options = $options;

    return $this->options;
}

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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