1

When I go back to the record editing page, all the inputs are empty, how do I drop values in those field from the database?

<?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" />
            <button name="save_and_continue" class="Ronis\Feedback\Block\Adminhtml\Feedback\Edit\Buttons\SaveAndContinue" />
        </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\FeedbackProvider" name="feedback_feedback_form_data_source">
            <settings>
                <requestFieldName>feedback_id</requestFieldName>
                <primaryFieldName>feedback_id</primaryFieldName>
            </settings>
        </dataProvider>
    </dataSource>

    <fieldset name="data_details">
        <settings>
            <label/>
        </settings>
        <field name="feedback_id" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">feedback</item>
                </item>
            </argument>
            <settings>
                <dataType>text</dataType>
                <visible>false</visible>
                <dataScope>feedback_id</dataScope>
            </settings>
        </field>
        <field name="feedback_name" 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">Name</label>
                <dataScope>feedback_name</dataScope>
            </settings>
        </field>
        <field name="feedback_content" formElement="textarea">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <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="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="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="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="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="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="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="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>

Your Answer

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

Browse other questions tagged or ask your own question.