AEM - CLOSE PAGE PROGRAMMATICALLY - HOW To

Avatar

Avatar

antonio_f

Avatar

antonio_f

antonio_f

02-04-2019

Dear forum,

as an AEM newbie developer I'm trying to close an AEM page programmatically.
What I'd like to do is to simulate the closure of the page without clicking on the close button using mouse.

But, after a lot of retries, I decided to ask help to you ( the forum ).

Any suggestion ?

Thanks All

BR,

Antonio

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

antonio_f

Avatar

antonio_f

antonio_f

02-04-2019

Hi,

I wish to create a page that behaves as a dialog box which contains 2 textbox field, an action button field and a close button.

What I'd like to reach is as follow:

The user press action buton on opened dialog box to make a few calc based on the contents of the textbox fields.

If  the calculation will end correctly the dialog box window close itself automatically otherwise it remains displayed on the screen until the user press the close button.

Answers (3)

Answers (3)

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

02-04-2019

Lokesh is correct - AEM does not expose an API to perform a use case that you are describing. You would need to look at writing JS script. 

Avatar

Avatar

bsloki

MVP

Total Posts

1.9K

Likes

172

Correct Answer

544

Avatar

bsloki

MVP

Total Posts

1.9K

Likes

172

Correct Answer

544
bsloki
MVP

02-04-2019

are you looking for modal popup ?

you can use window.close() function in JS to close the page/ popup you have opened.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

02-04-2019

I am not sure what you mean by closing a page. TO me that sound like you want to close the browser that is displaying the page.

Can you please provide more detail.