3

I can not save the data in the database when editing the record, the data remains the same as it was before

Ronis\Feedback\Api\Feedback\FeedbackInterface.php

<?php

namespace Ronis\Feedback\Api\Feedback;

interface FeedbackInterface
{
    /**
     * Constants for keys of feedback array. Identical to the name of the getter in snake case
     */
    const FEEDBACK_ID           = 'feedback_id';
    const FEEDBACK_NAME        = 'feedback_name';
    const FEEDBACK_CONTENT  = 'feedback_content';
    const FEEDBACK_EMAIL  = 'feedback_email';
    const FEEDBACK_SUBJECT  = 'feedback_subject';
    const FEEDBACK_USER_AGENT  = 'feedback_user_agent';
    const FEEDBACK_REMOTE_IP  = 'feedback_remote_ip';
    const IS_ACTIVE         = 'is_active';
    const CREATED_AT        = 'created_at';
    const UPDATED_AT        = 'updated_at';


    /**
     * Get ID
     *
     * @return int|null
     */
    public function getId();

    /**
     * Set ID
     *
     * @param $id
     * @return FeedbackInterface
     */
    public function setId($id);

    /**
     * Get Feedback Name
     *
     * @return string
     */
    public function getFeedbackName();

    /**
     * Set Feedback Name
     *
     * @param $name
     * @return mixed
     */
    public function setFeedbackName($name);

    /**
     * Get Feedback Content
     *
     * @return mixed
     */
    public function getFeedbackContent();

    /**
     * Set Feedback Content
     *
     * @param $content
     * @return mixed
     */
    public function setFeedbackContent($content);

    /**
     * Get Feedback Email
     *
     * @return mixed
     */
    public function getFeedbackEmail();

    /**
     * Set Feedback Email
     *
     * @param $email
     * @return mixed
     */
    public function setFeedbackEmail($email);

    /**
     * Get Feedback Subject
     *
     * @return mixed
     */
    public function getFeedbackSubject();

    /**
     * Set Feedback Subject
     *
     * @param $subject
     * @return mixed
     */
    public function setFeedbackSubject($subject);

    /**
     * Get Feedback User Agent
     *
     * @return mixed
     */
    public function getFeedbackUserAgent();

    /**
     * Set Feedback User Agent
     *
     * @param $user_agent
     * @return mixed
     */
    public function setFeedbackUserAgent($user_agent);

    /**
     * Get Feedback Remote Ap
     *
     * @return mixed
     */
    public function getFeedbackRemoteIP();

    /**
     * Set Feedback Remote Ip
     *
     * @param $remote_ip
     * @return mixed
     */
    public function setFeedbackRemoteIp($remote_ip);

    /**
     * Get is active
     *
     * @return bool|int
     */
    public function getIsActive();

    /**
     * Set is active
     *
     * @param $isActive
     * @return FeedbackInterface
     */
    public function setIsActive($isActive);

    /**
     * Get created at
     *
     * @return string
     */
    public function getCreatedAt();

    /**
     * set created at
     *
     * @param $createdAt
     * @return FeedbackInterface
     */
    public function setCreatedAt($createdAt);

    /**
     * Get updated at
     *
     * @return string
     */
    public function getUpdatedAt();

    /**
     * set updated at
     *
     * @param $updatedAt
     * @return FeedbackInterface
     */
    public function setUpdatedAt($updatedAt);
}

Ronis\Feedback\Controller\Adminhtml\Feedback\Save.php

<?php
namespace Ronis\Feedback\Controller\Adminhtml\Feedback;

use Magento\Framework\Registry;
use Magento\Framework\View\Result\PageFactory;
use Magento\Backend\Model\View\Result\ForwardFactory;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Message\Manager;
use Magento\Framework\Api\DataObjectHelper;
use Ronis\Feedback\Api\FeedbackRepositoryInterface;
use Ronis\Feedback\Api\Feedback\FeedbackInterface;
use Ronis\Feedback\Api\Feedback\FeedbackInterfaceFactory;
use Ronis\Feedback\Controller\Adminhtml\Feedback;

class Save extends Feedback
{
    /**
     * @var Manager
     */
    protected $messageManager;

    /**
     * @var FeedbackRepositoryInterface
     */
    protected $feedbackRepository;

    /**
     * @var FeedbackInterfaceFactory
     */
    protected $feedbackFactory;

    /**
     * @var DataObjectHelper
     */
    protected $dataObjectHelper;

    public function __construct(
        Registry $registry,
        FeedbackRepositoryInterface $feedbackRepository,
        PageFactory $resultPageFactory,
        ForwardFactory $resultForwardFactory,
        Manager $messageManager,
        FeedbackInterfaceFactory $feedbackFactory,
        DataObjectHelper $dataObjectHelper,
        Context $context
    ) {
        $this->messageManager   = $messageManager;
        $this->feedbackFactory      = $feedbackFactory;
        $this->feedbackRepository   = $feedbackRepository;
        $this->dataObjectHelper  = $dataObjectHelper;
        parent::__construct($registry, $feedbackRepository, $resultPageFactory, $resultForwardFactory, $context);
    }

    /**
     * Save action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        $feedback = $this->getRequest()->getPostValue();
        $resultRedirect = $this->resultRedirectFactory->create();
        if ($feedback) {
            $id = $this->getRequest()->getParam('feedback_id');
            $model = $this->feedbackRepository->getById($id);

            try {
                $this->dataObjectHelper->populateWithArray($model, $feedback, FeedbackInterface::class);
                $this->feedbackRepository->save($model);
                $this->messageManager->addSuccessMessage(__('You saved this feedback.'));
                $this->_getSession()->setFormData(false);
                if ($this->getRequest()->getParam('back')) {
                    return $resultRedirect->setPath('*/*/edit', ['feedback_id' => $model->getId(), '_current' => true]);
                }
                return $resultRedirect->setPath('*/*/');
            } catch (\Magento\Framework\Exception\LocalizedException $e) {
                $this->messageManager->addErrorMessage($e->getMessage());
            } catch (\RuntimeException $e) {
                $this->messageManager->addErrorMessage($e->getMessage());
            } catch (\Exception $e) {
                $this->messageManager->addException($e, __('Something went wrong while saving the feedback.'));
            }

            $this->_getSession()->setFormData($feedback);
            return $resultRedirect->setPath('*/*/edit', ['feedback_id' => $this->getRequest()->getParam('feedback_id')]);
        }
        return $resultRedirect->setPath('*/*/');
    }
}

Ronis\Feedback\Controller\Adminhtml\Feedback.php

<?php
namespace Ronis\Feedback\Controller\Adminhtml;

us    <?php
namespace Ronis\Feedback\Controller\Adminhtml;

use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Registry;
use Magento\Framework\View\Result\PageFactory;
use Magento\Backend\Model\View\Result\ForwardFactory;
use Ronis\Feedback\Api\FeedbackRepositoryInterface;

abstract class Feedback extends Action
{
    /**
     * Authorization level of a basic admin session
     *
     * @see _isAllowed()
     */
    const ACTION_RESOURCE = 'Ronis_Feedback::feedback';

    /**
     * Feedback repository
     *
     * @var FeedbackRepositoryInterface
     */
    protected $feedbackRepository;

    /**
     * Core registry
     *
     * @var Registry
     */
    protected $coreRegistry;

    /**
     * Result Page Factory
     *
     * @var PageFactory
     */
    protected $resultPageFactory;

    /**
     * Result Forward Factory
     *
     * @var ForwardFactory
     */
    protected $resultForwardFactory;

    /**
     * Feedback constructor.
     *
     * @param Registry $registry
     * @param FeedbackRepositoryInterface $feedbackRepository
     * @param PageFactory $resultPageFactory
     * @param ForwardFactory $resultForwardFactory
     * @param Context $context
     */
    public function __construct(
        Registry $registry,
        FeedbackRepositoryInterface $feedbackRepository,
        PageFactory $resultPageFactory,
        ForwardFactory $resultForwardFactory,
        Context $context
    ) {
        $this->coreRegistry         = $registry;
        $this->feedbackRepository       = $feedbackRepository;
        $this->resultPageFactory    = $resultPageFactory;
        $this->resultForwardFactory = $resultForwardFactory;
        parent::__construct($context);
    }
}e Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Registry;
use Magento\Framework\View\Result\PageFactory;
use Magento\Backend\Model\View\Result\ForwardFactory;
use Ronis\Feedback\Api\FeedbackRepositoryInterface;

abstract class Feedback extends Action
{
    /**
     * Authorization level of a basic admin session
     *
     * @see _isAllowed()
     */
    const ACTION_RESOURCE = 'Ronis_Feedback::feedback';

    /**
     * Feedback repository
     *
     * @var FeedbackRepositoryInterface
     */
    protected $feedbackRepository;

    /**
     * Core registry
     *
     * @var Registry
     */
    protected $coreRegistry;

    /**
     * Result Page Factory
     *
     * @var PageFactory
     */
    protected $resultPageFactory;

    /**
     * Result Forward Factory
     *
     * @var ForwardFactory
     */
    protected $resultForwardFactory;

    /**
     * Feedback constructor.
     *
     * @param Registry $registry
     * @param FeedbackRepositoryInterface $feedbackRepository
     * @param PageFactory $resultPageFactory
     * @param ForwardFactory $resultForwardFactory
     * @param Context $context
     */
    public function __construct(
        Registry $registry,
        FeedbackRepositoryInterface $feedbackRepository,
        PageFactory $resultPageFactory,
        ForwardFactory $resultForwardFactory,
        Context $context
    ) {
        $this->coreRegistry         = $registry;
        $this->feedbackRepository       = $feedbackRepository;
        $this->resultPageFactory    = $resultPageFactory;
        $this->resultForwardFactory = $resultForwardFactory;
        parent::__construct($context);
    }
}

Ronis\Feedback\ModelFeedback.php

<?php

namespace Ronis\Feedback\Model;

use Magento\Framework\Model\AbstractModel;
use Ronis\Feedback\Api\Feedback\FeedbackInterface;

class Feedback extends AbstractModel implements FeedbackInterface
{
    /**
     * Cache tag
     */
    const CACHE_TAG = 'ronis_feedback_feedback';

    /**
     * Initialise resource model
     * @codingStandardsIgnoreStart
     */
    protected function _construct()
    {
        // @codingStandardsIgnoreEnd
        $this->_init('Ronis\Feedback\Model\ResourceModel\Feedback');
    }

    /**
     * Get cache identities
     *
     * @return array
     */
    public function getIdentities()
    {
        return [self::CACHE_TAG . '_' . $this->getId()];
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getFeedbackName()
    {
        return $this->getData(FeedbackInterface::FEEDBACK_NAME);
    }

    /**
     * Set name
     *
     * @param $name
     * @return $this
     */
    public function setFeedbackName($name)
    {
        return $this->setData(FeedbackInterface::FEEDBACK_NAME, $name);
    }

    /**
     * Get Feedback content
     *
     * @return string
     */
    public function getFeedbackContent()
    {
        return $this->getData(FeedbackInterface::FEEDBACK_CONTENT);
    }

    /**
     * Set feedback content
     *
     * @param $content
     * @return $this
     */
    public function setFeedbackContent($content)
    {
        return $this->setData(FeedbackInterface::FEEDBACK_CONTENT, $content);
    }

    /**
     * Get Feedback email
     *
     * @return string
     */
    public function getFeedbackEmail()
    {
        return $this->getData(FeedbackInterface::FEEDBACK_EMAIL);
    }

    /**
     * Set feedback email
     *
     * @param $email
     * @return $this
     */
    public function setFeedbackEmail($email)
    {
        return $this->setData(FeedbackInterface::FEEDBACK_EMAIL, $email);
    }

    /**
     * Get Feedback subject
     *
     * @return string
     */
    public function getFeedbackSubject()
    {
        return $this->getData(FeedbackInterface::FEEDBACK_SUBJECT);
    }

    /**
     * Set feedback subject
     *
     * @param $subject
     * @return $this
     */
    public function setFeedbackSubject($subject)
    {
        return $this->setData(FeedbackInterface::FEEDBACK_SUBJECT, $subject);
    }

    /**
     * Get Feedback user agent
     *
     * @return string
     */
    public function getFeedbackUserAgent()
    {
        return $this->getData(FeedbackInterface::FEEDBACK_USER_AGENT);
    }

    /**
     * Set feedback user agent
     *
     * @param $user_agent
     * @return $this
     */
    public function setFeedbackUserAgent($user_agent)
    {
        return $this->setData(FeedbackInterface::FEEDBACK_USER_AGENT, $user_agent);
    }

    /**
     * Get Feedback remote ap
     *
     * @return string
     */
    public function getFeedbackRemoteIP()
    {
        return $this->getData(FeedbackInterface::FEEDBACK_REMOTE_IP);
    }

    /**
     * Set feedback remote ip
     *
     * @param $remote_ip
     * @return $this
     */
    public function setFeedbackRemoteIp($remote_ip)
    {
        return $this->setData(FeedbackInterface::FEEDBACK_REMOTE_IP, $remote_ip);
    }

    /**
     * Get is active
     *
     * @return bool|int
     */
    public function getIsActive()
    {
        return $this->getData(FeedbackInterface::IS_ACTIVE);
    }

    /**
     * Set is active
     *
     * @param $isActive
     * @return $this
     */
    public function setIsActive($isActive)
    {
        return $this->setData(FeedbackInterface::IS_ACTIVE, $isActive);
    }

    /**
     * Get created at
     *
     * @return string
     */
    public function getCreatedAt()
    {
        return $this->getData(FeedbackInterface::CREATED_AT);
    }

    /**
     * Set created at
     *
     * @param $createdAt
     * @return $this
     */
    public function setCreatedAt($createdAt)
    {
        return $this->setData(FeedbackInterface::CREATED_AT, $createdAt);
    }

    /**
     * Get updated at
     *
     * @return string
     */
    public function getUpdatedAt()
    {
        return $this->getData(FeedbackInterface::UPDATED_AT);
    }

    /**
     * Set updated at
     *
     * @param $updatedAt
     * @return $this
     */
    public function setUpdatedAt($updatedAt)
    {
        return $this->setData(FeedbackInterface::UPDATED_AT, $updatedAt);
    }
}

Ronis\Feedback\view\ui_component\feedback_feedback_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">feedback_feedback_form.feedback_feedback_form_data_source</item>
        </item>
        <item name="label" xsi:type="string" translate="true">Feedback Information</item>
        <item name="template" xsi:type="string">templates/form/collapsible</item>
    </argument>
    <settings>
        <buttons>
            <button name="back" class="Ronis\Feedback\Block\Adminhtml\Feedback\Edit\Buttons\Back" />
            <button name="delete" class="Ronis\Feedback\Block\Adminhtml\Feedback\Edit\Buttons\Delete" />
            <button name="reset" class="Ronis\Feedback\Block\Adminhtml\Feedback\Edit\Buttons\Reset" />
            <button name="save" class="Ronis\Feedback\Block\Adminhtml\Feedback\Edit\Buttons\Save" />
        </buttons>
        <namespace>feedback_form</namespace>
        <dataScope>feedback</dataScope>
        <deps>
            <dep>feedback_feedback_form.feedback_feedback_form_data_source</dep>
        </deps>
    </settings>
    <dataSource name="feedback_feedback_form_data_source">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
            </item>
        </argument>
        <settings>
            <submitUrl path="feedback/feedback/save"/>
        </settings>
        <dataProvider class="Ronis\Feedback\Model\DataProvider" name="feedback_feedback_form_data_source">
            <settings>
                <requestFieldName>feedback_id</requestFieldName>
                <primaryFieldName>feedback_id</primaryFieldName>
            </settings>
        </dataProvider>
    </dataSource>

    <fieldset name="feedback_details">
        <settings>
            <label/>
        </settings>
        <field name="feedback_id" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <dataType>text</dataType>
                <label translate="true">Feedback id</label>
                <visible>true</visible>
                <dataScope>feedback_id</dataScope>
            </settings>
        </field>

        <field name="feedback_name">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Name 1</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <!--<item name="disabled" xsi:type="boolean">true</item>-->
                    <item name="dataScope" xsi:type="string">feedback_name</item>
                </item>
            </argument>
        </field>

        <field name="feedback_content" formElement="textarea">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">Content</label>
                <dataScope>feedback_content</dataScope>
            </settings>
        </field>
        <field name="feedback_email" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">Email</label>
                <dataScope>feedback_email</dataScope>
            </settings>
        </field>
        <field name="feedback_telephone" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">Phone</label>
                <dataScope>feedback_telephone</dataScope>
            </settings>
        </field>
        <field name="feedback_subject" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">Subject</label>
                <dataScope>feedback_subject</dataScope>
            </settings>
        </field>
        <field name="feedback_user_agent" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">User agent</label>
                <dataScope>feedback_user_agent</dataScope>
            </settings>
        </field>
        <field name="feedback_remote_ai" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">Remote IP</label>
                <dataScope>feedback_remote_ai</dataScope>
            </settings>
        </field>

        <field name="is_active" formElement="select" sortOrder="10">
            <settings>
                <dataType>text</dataType>
                <label translate="true">Status</label>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
            </settings>
            <formElements>
                <select>
                    <settings>
                        <options class="Ronis\Feedback\Model\Feedback\Source\Status"/>
                    </settings>
                </select>
            </formElements>
        </field>

        <field name="feedback_created_at" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">Created At</label>
                <dataScope>feedback_created_at</dataScope>
            </settings>
        </field>
        <field name="feedback_updated_at" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">Updated At</label>
                <dataScope>feedback_updated_at</dataScope>
            </settings>
        </field>
    </fieldset>
</form>
  • When I print var_dump($feedback) in controller "Save" then the data from the form is not recorded, it feels like the data from the form does not come to the record, and it simply does not see this data and you have nothing to save because the new data did not come. – Рома Лытарь Mar 12 at 8:42
  • The error was in the form, corrected – Рома Лытарь Mar 12 at 8:53
0

feedback_feedback_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">feedback_feedback_form.feedback_feedback_form_data_source</item>
            <item name="deps" xsi:type="string">feedback_feedback_form.feedback_feedback_form_data_source</item>
        </item>
        <item name="label" xsi:type="string" translate="true">Feedback Information</item>
        <item name="config" xsi:type="array">
            <item name="dataScope" xsi:type="string">data</item>
            <item name="namespace" xsi:type="string">feedback_form</item>
        </item>
        <item name="template" xsi:type="string">templates/form/collapsible</item>
    </argument>
    <settings>
        <buttons>
            <button name="back" class="Ronis\Feedback\Block\Adminhtml\Feedback\Edit\Buttons\Back" />
            <button name="delete" class="Ronis\Feedback\Block\Adminhtml\Feedback\Edit\Buttons\Delete" />
            <button name="reset" class="Ronis\Feedback\Block\Adminhtml\Feedback\Edit\Buttons\Reset" />
            <button name="save" class="Ronis\Feedback\Block\Adminhtml\Feedback\Edit\Buttons\Save" />
        </buttons>
        <namespace>feedback_form</namespace>
        <dataScope>feedback</dataScope>
        <deps>
            <dep>feedback_feedback_form.feedback_feedback_form_data_source</dep>
        </deps>
    </settings>

    <dataSource name="feedback_feedback_form_data_source">
        <argument name="dataProvider" xsi:type="configurableObject">
            <argument name="class" xsi:type="string">Ronis\Feedback\Model\DataProvider</argument>
            <argument name="name" xsi:type="string">feedback_feedback_form_data_source</argument>
            <argument name="primaryFieldName" xsi:type="string">feedback_id</argument>
            <argument name="requestFieldName" xsi:type="string">feedback_id</argument>
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="submit_url" xsi:type="url" path="feedback/feedback/save"/>
                </item>
            </argument>
        </argument>
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
            </item>
        </argument>
    </dataSource>

    <fieldset name="feedback_details">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Feedback Details</item>
            </item>
        </argument>
        <field name="feedback_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="visible" xsi:type="boolean">false</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Feedback ID</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_id</item>
                </item>
            </argument>
        </field>

        <field name="feedback_name">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Name</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_name</item>
                </item>
            </argument>
        </field>

        <field name="feedback_content">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Content</item>
                    <item name="formElement" xsi:type="string">textarea</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_content</item>
                </item>
            </argument>
        </field>

        <field name="feedback_email">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Email</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_email</item>
                </item>
            </argument>
        </field>

        <field name="feedback_telephone">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Phone</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_telephone</item>
                </item>
            </argument>
        </field>

        <field name="feedback_subject">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Subject</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_subject</item>
                </item>
            </argument>
        </field>

        <field name="feedback_user_agent">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">User agent</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_user_agent</item>
                </item>
            </argument>
        </field>

        <field name="feedback_remote_ai">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Remote IP</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_remote_ai</item>
                </item>
            </argument>
        </field>

        <field name="is_active" formElement="select" sortOrder="10">
            <settings>
                <dataType>text</dataType>
                <label translate="true">Status</label>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
            </settings>
            <formElements>
                <select>
                    <settings>
                        <options class="Ronis\Feedback\Model\Feedback\Source\Status"/>
                    </settings>
                </select>
            </formElements>
        </field>


        <field name="feedback_created_at">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Created At</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_created_at</item>
                </item>
            </argument>
        </field>

        <field name="feedback_updated_at">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Updated At</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">data</item>
                    <item name="dataScope" xsi:type="string">feedback_updated_at</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

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.