Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

component renders only on page refresh

Avatar

Level 3

On authoring a customized component dialog, component does not render on click of done in the dialog.

It renders fine only after reloading the page. 

What can be the possible fix?

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Dolly 

 

The component doesn't render the latest changes from the dialog unless you define a edit behaviour or refresh the page. In order to define a edit behaviour you can create a cq:EditConfigand a cq:listeners. Below is a sample xml. This will reload the page as soon as you submit a dialog so that the latest changes from the dialog are displayed. 

 

<jcr:root xmlns:cq="https://www.day.com/jcr/cq/1.0" xmlns:jcr="https://www.jcp.org/jcr/1.0"
    cq:actions="[edit]"
    cq:dialogMode="floating"
    cq:layout="editbar"
    jcr:primaryType="cq:EditConfig">
    <cq:listeners
        jcr:primaryType="cq:EditListenersConfig"
        afteredit="REFRESH_PAGE"/>
</jcr:root>

 Please find below the adobe documentation for the same.

https://experienceleague.adobe.com/docs/experience-manager-65/developing/components/components-basic...

 

Thanks

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @Dolly 

 

The component doesn't render the latest changes from the dialog unless you define a edit behaviour or refresh the page. In order to define a edit behaviour you can create a cq:EditConfigand a cq:listeners. Below is a sample xml. This will reload the page as soon as you submit a dialog so that the latest changes from the dialog are displayed. 

 

<jcr:root xmlns:cq="https://www.day.com/jcr/cq/1.0" xmlns:jcr="https://www.jcp.org/jcr/1.0"
    cq:actions="[edit]"
    cq:dialogMode="floating"
    cq:layout="editbar"
    jcr:primaryType="cq:EditConfig">
    <cq:listeners
        jcr:primaryType="cq:EditListenersConfig"
        afteredit="REFRESH_PAGE"/>
</jcr:root>

 Please find below the adobe documentation for the same.

https://experienceleague.adobe.com/docs/experience-manager-65/developing/components/components-basic...

 

Thanks

Avatar

Level 3

Thanks @JeevanRaj . This helped.

I tried to use 'REFRESH_SELF' instead of refreshing the whole page. But it does not seem to refresh the component.

Please help

Avatar

Community Advisor

'REFRESH_SELF' is working for me. Below is the screenshot of the config. Please cross-check whether it is configured correctly.

dev_aem_0-1648631290093.png

dev_aem_1-1648631307650.png

Thanks

Avatar

Community Advisor

@Dolly 

Just curious about this. What type of component is this? Is it dynamic with some logic that it needs a refresh? In general, if click of ok without a refresh, a simpler component should render directly. Do you see a console error when ok is pressed?

If it helps someone..

We faced a similar issue in classic ui 6.5.10 where for a simple title component itself, without refresh the component won't render in classic and was throwing a 400 error. For a fix we had to overlay some file where the ootb file was checking for selector and adding addition "." to the url resulting into a 400 request..

Avatar

Level 3

@Shubham_borole it is a customized component with textfield, multifield, pathfield, richtext.
On click of dialog done, I do not see any error