Dialog Coral UI Issue - Changing field to "fileupload" | Community
Skip to main content
NageshRaja
Level 5
March 19, 2026
Question

Dialog Coral UI Issue - Changing field to "fileupload"

  • March 19, 2026
  • 2 replies
  • 12 views

Hi Everyone, 

 

We had a 3rd party DAM system which was tied to our dialog by a custom sling:resourceType “/apps/custom-connector/core/ui/components/content/custom-pathfield”

This is now being replaced with “cq/gui/components/authoring/dialog/fileupload” modeled on Image V3 component to allow Remote Asset Picker feature on the dialog.

Previously if we had a field say “heroImage” which hosted the old URL “https://media-www.abc.com/test.png” 
This is now replaced by having a fileReference field “heroImagefileReference” which hosts the delivery API URL when an author selects the image from remote DAM instance such as “/urn:aaid:aem:000a885c-3807-4fbb-9a2f-9a6ae3120ccf/58fb9408-test.png”

The image renders well on both authoring dialog, editor.html view and even published page.

We also have written the sling model such that if no value is present in “fileReference” then we read the value in original “heroImage” to continue rendering the image. 

This works fine on view mode but in the authoring dialog we get the below - 

 

This is the HTML for it -
<img src="/content/projA/en/home-page/home-dam/jcr:content/root/responsivegrid/componentNameA.img.png?ch_ck=1773773358000" alt="/content/projA/en/home-page/home-dam/jcr:content/root/responsivegrid/componentNameA" title="/content/projA/en/home-page/home-dam/jcr:content/root/responsivegrid/componentNameA">
If I manually replace the src with value from original “heroImage” then the image appears correctly.

 

What will the best fix for this?

Thanks in advance!

 

    2 replies

    rk_pandian
    Level 4
    March 19, 2026

    Hello ​@NageshRaja , a few questions here:

    1. what do you see in the authoring dialog? is it the thumbnail of the component?
    2. Should your logic not be doing, if there is no heroImagefileReference then pick up the value from heroImage?
    3. I would like to understand why you want to read fileReference as that is handled by AEM Image servlet, so it will try to populate some value as a default value.

    Maybe you can share the code from dialog and the sling model, then I can have a better clarity at the issue.

     

    Regards,

    Ramkumar

    AmitVishwakarma
    Community Advisor
    Community Advisor
    March 20, 2026

    Hi ​@NageshRaja 

    What you're seeing is expected with this setup:

    • The fileupload/Remote Asset Picker + Image V3 pattern always previews via the image servlet > it generates …/componentNameA.img.png?... and expects a valid fileReference (DAM/remote asset).
    • Your fallback logic (heroImage > old 3rd‑party URL) lives only in the Sling Model / view and is not used by that servlet.
    • So:
      • View / publish: your Sling Model returns heroImage > <img src="https://media-www.abc.com/test.png"> => works.
      • Authoring dialog: the preview still calls …componentNameA.img.png > servlet sees empty fileReference => broken image.

    That's why manually changing src to the heroImage URL fixes it: you're bypassing the *.img.png servlet.

    Stop using the *.img.png URL for the legacy case and always drive src from your model.

    Concretely:

    1. In your Sling Model, expose a single, effective URL:

    public String getEffectiveSrc() {
    if (StringUtils.isNotBlank(fileReference)) {
    // new remote DAM / Image V3 path (let core image logic handle it)
    return fileReference;
    }
    // legacy 3rd‑party URL
    return heroImage;
    }

    2.In your component HTL/JSP, do not render …componentNameA.img.png when you rely on fallback.

    Instead, bind the img to the model:

    <img src="${imageModel.effectiveSrc @ context='uri'}"
    alt="${imageModel.altText}"
    title="${imageModel.altText}" />
    • Remove/avoid patterns like: <img src="${resource.path}.img.png" ...>
    • or image.src when that resolves to *.img.png for the legacy branch.

    3. Use this same markup for both:

    • editor.html (author mode)
    • page.html (view/publish)

    Once the src is coming directly from getEffectiveSrc() everywhere:

    • New content (with heroImagefileReference) still works as before.
    • Old content (with only heroImage) renders correctly in both dialog and editor preview.
    • No extra JS or GuideBridge, works fine with your Remote Asset + third‑party DAM mix.
    Amit Vishwakarma - Adobe Commerce Champion 2025 | 16x Adobe certified | 4x Adobe SME