Send data from dialog to a servlet. | Community
Skip to main content
Level 4
May 21, 2018
Solved

Send data from dialog to a servlet.

  • May 21, 2018
  • 7 replies
  • 3411 views

Hi guys,

I'm using AEM 6.2 and I'm looking for a way to send values from my component's dialog to a servlet.

is this a way to submit the data when the author confirms the dialog ?

Can you point me some resource into this ?

Thanks !

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

If you want to pass data an author entered into a dialog to an AEM Java backend - why not use HTL and WCMUsePojo.

7 replies

edubey
Level 10
May 21, 2018

Yes, but by default AEM will submit the resource to based on form action for that resource node.

But you can add your custom JS code based on event, like submit/success to send data to your servlet.

Adobe Experience Manager Help | Using Event Handlers in Adobe Experience Manager Touch UI Components

Level 4
May 21, 2018

So let me ask to see if i understood correctly.

I can add a listener.js and configure it so when i press confirm on the component's dialog it will send an AJAX post request to my servlet with the values form the component ?

Thanks

smacdonald2008
smacdonald2008Accepted solution
Level 10
May 21, 2018

If you want to pass data an author entered into a dialog to an AEM Java backend - why not use HTL and WCMUsePojo.

edubey
Level 10
May 21, 2018

Yes, but what is your use case?

Level 4
May 21, 2018

Yeah, as an author I want to send the data from cq dialog to a servlet.

smacdonald2008
Level 10
May 21, 2018

It makes more sense to use Sling Models or WCMUsePojo to get dialog data to Java logic.

Scott's Digital Community: Creating an AEM HTML Template Language component that uses the WCMUsePojo class

Level 4
May 21, 2018

I will check it out. Thank you very much.