Expand my Community achievements bar.

SOLVED

How to refresh the browser after the HTML response is sent to the client browser?

Avatar

Level 5

Hi,

Any suggestion on how to refresh the browser after the HTML response is sent to the client browser?

This is the use case

1. XDP form is rendered as HTML in the client browser.

2. User fills in the form and clicks on the submit button.

3. The HTML form is posted to the server.

4. The server processes the request and generates a flat PDF and sends it to the client browser.

5. The PDF is available for download and it is visible in the browser status bar.

Currently the user needs to manually refresh the page by clicking on the browser's refresh button, after the pdf is received in the client-side, to see the blank form again.

Adaptive forms are not used here. We are using CRX repository and custom code to render XDP form as HTML5 form.

In the POST jsp code there is only one request and response that is being processed. 

Is there a way to redirect the user to a thank you page with a 'ok' button (after the pdf is received on the client-side), and then redirect this page back to the original page after the user clicks 'ok'? How can this be done? Or is there any other better suggestion?

Thanks,

Leena

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello, @aemuser001 
Have checked this? - https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/forms/create-an-ada...

 

It seems to talk about default after submit options.

 

Also https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/forms/create-an-ada...

This talks about customizing submit options. 

 

I also see here (https://www.youtube.com/watch?v=2Pvfu5f7seo) an example of calling a servlet post submit. As part of this may be an appropriate redirect/forward can be configured.

 

I hope this is in sync to what is asked.

Also try posting this in https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-forms/ct-p/adobe-experienc... 

Thanks

View solution in original post

9 Replies

Avatar

Community Advisor

Hi,

How are you making a post request? is it using ajax or using action attribute in the form?



Arun Patidar

Avatar

Level 5

Hi Arun,

The XDP form is developed using the AEM Designer. The XDP form has a HTMLSubmit Button. This form is rendered as HTML form in the browser. When the user clicks this button, a Post request with the XML data is sent to the server. The jsp code handles this request, generates the flat pdf and sends the pdf document back to the client browser. No ajax is used here. 

I hope this answer's your question.

Thanks,

Leena

Avatar

Community Advisor

Hi @aemuser001 
Thanks for adding more info. I am not sure If I can help you with this. I am no expert in XDP forms.

I hope other member of community can help you out.



Arun Patidar

Avatar

Correct answer by
Community Advisor

Hello, @aemuser001 
Have checked this? - https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/forms/create-an-ada...

 

It seems to talk about default after submit options.

 

Also https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/forms/create-an-ada...

This talks about customizing submit options. 

 

I also see here (https://www.youtube.com/watch?v=2Pvfu5f7seo) an example of calling a servlet post submit. As part of this may be an appropriate redirect/forward can be configured.

 

I hope this is in sync to what is asked.

Also try posting this in https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-forms/ct-p/adobe-experienc... 

Thanks

Avatar

Level 5

Hi Shubham,

The links provided are related to adaptive forms and they do not have the solution in this case.

Thanks,

Leena

Avatar

Level 5

Hi,

When the PDF file is sent to the Client-side as a response, is there any HHTP response header that can be used to alert the client-browser to refresh the main page or show s pop-up message box with an 'ok' button?

Is it possible to embed a client-side script when the response is sent from the server to the client? 

Thanks,

Leena

Avatar

Community Advisor

Sorry for the wrong references. May be we can try posting here if any AEM Forms experts have some idea

Avatar

Level 5

Hi Shubham,

I did not realize that this question is in AEM Sites & More. Sorry about this, I will post the question in AEM Forms section.

Thanks,

Leena