0

Created a custom image section using new tab customer_form.xml in customer admin panel, after upload the image using <imports> & <exports> to preview the image. enter image description here

  1. When remove the <exports> image preview works , but unable to send the new file data
  2. When remove the <imports> image preview will not work , but new file data send

Someone please give the solutions for this

Customer_form.xml

false Dealer Adon Information fieldset customer Dealer Information customer 1 true true
<field name="logo">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
        <item name="dataType" xsi:type="string">string</item>
        <item name="source" xsi:type="string">customer</item>
        <item name="label" xsi:type="string" translate="true">Thumbnail</item>
        <item name="visible" xsi:type="boolean">true</item>
        <item name="formElement" xsi:type="string">fileUploader</item>
        <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
        <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
        <item name="required" xsi:type="boolean">false</item>
        <item name="sortOrder" xsi:type="number">40</item>

        <item name="uploaderConfig" xsi:type="array">
            
            <item name="url" xsi:type="url" path="customer/file/customer_upload"/>
            </item>
            <item name="imports" xsi:type="array">
                <item name="value" xsi:type="string">${ $.provider }:data.customer.logo</item>
            </item>
            <item name="exports" xsi:type="array">
                <item name="value" xsi:type="string">${ $.provider }:data.customer.logo</item>
            </item>
        </item> 

0

Your Answer

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

Browse other questions tagged or ask your own question.