How to refresh the browser after the HTML response is sent to the client browser? | Community
Skip to main content
Level 5
January 6, 2022
Solved

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

  • January 6, 2022
  • 2 replies
  • 2629 views

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

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

arunpatidar
Community Advisor
Community Advisor
January 6, 2022

Hi,

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

Arun Patidar
Level 5
January 6, 2022

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

arunpatidar
Community Advisor
Community Advisor
January 7, 2022

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
Shubham_borole
Community Advisor
Shubham_boroleCommunity AdvisorAccepted solution
Community Advisor
January 7, 2022
Level 5
January 7, 2022

Hi Shubham,

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

Thanks,

Leena

Shubham_borole
Community Advisor
Community Advisor
January 8, 2022

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