- I wish to create a form in admin.
- The purpose of the form is not CRUD.
- Using blocks for creating forms is marked as deprecated in favor of ui_component forms
- Is it possible to use a ui component form without a data source?
-
Hello @vitoriodachef, did you find any solution?vedu– vedu2018-05-25 05:17:53 +00:00Commented May 25, 2018 at 5:17
-
@vedu Please check my answervitoriodachef– vitoriodachef2018-05-25 09:17:29 +00:00Commented May 25, 2018 at 9:17
Add a comment
|
1 Answer
From my digging it turns out the data provider is required.
I just implemented a dummy data provider.
class Form extends \Magento\Ui\DataProvider\AbstractDataProvider
{
/**
* Get data
*
* @return array
*/
public function getData()
{
return [];
}
public function addFilter(\Magento\Framework\Api\Filter $filter)
{
return;
}
}
I had to override both methods that work with $collection member to avoid errors.
-
Does that works still on 2.4.6 ?Christophe Ferreboeuf– Christophe Ferreboeuf2024-02-01 07:38:49 +00:00Commented Feb 1, 2024 at 7:38