Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Call a servlet upon checking a checkbox through page properties.

Avatar

Level 3

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@Nilesh_Mali 

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

 

 

SivakumarKanoori_1-1693304054720.png

 

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

View solution in original post

2 Replies

Avatar

Employee

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.

Avatar

Correct answer by
Community Advisor

@Nilesh_Mali 

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

 

 

SivakumarKanoori_1-1693304054720.png

 

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