Call a servlet upon checking a checkbox through page properties. | Community
Skip to main content
Nilesh_Mali
Level 3
August 29, 2023
Solved

Call a servlet upon checking a checkbox through page properties.

  • August 29, 2023
  • 1 reply
  • 718 views

I have added a custom checkbox to the page properties and am attempting to invoke a servlet when the author checks this checkbox.

ICurrently searching for the precise code or file that needs to be overridden within the 'apps' directory in order to call the servlet.

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 SivakumarKanoori

@nilesh_mali 

You can give a unique class name at checkbox field as below. and write jQuery event .

 

 

 

and then in the JS file add a function, to handle the select option on this field

$(document).on("selected", ".cq-dialog-layout", function() {

// ajax call to make servlet

}

 

Thanks ,

Siva

1 reply

varun249715
Adobe Employee
Adobe Employee
August 29, 2023

Hi @nilesh_mali 

Instead of overriding in apps file. You can create a clientlibrary which will call a servlet on the checkbox event. Since you have created a custom property you can have a custom class or id name for checkbox.

SivakumarKanoori
Community Advisor
SivakumarKanooriCommunity AdvisorAccepted solution
Community Advisor
August 29, 2023

@nilesh_mali 

You can give a unique class name at checkbox field as below. and write jQuery event .

 

 

 

and then in the JS file add a function, to handle the select option on this field

$(document).on("selected", ".cq-dialog-layout", function() {

// ajax call to make servlet

}

 

Thanks ,

Siva

Thanks,Siva