Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Servlet trigger on dialog textfield in touchui

sr508
Level 3
Level 3

Hi,

I wanted a servlet trigger on textfield of dialog in touchui.

I tried with datasource node , but didn't work out.

Is datasource should be used in specific with servlet?

If so is there a way to trigger a servlet from textfield in touchui dialog.

Currently I am using aem6.4

Thanks in advance!!

0 Replies
GaneshM
Level 3
Level 3

You can use <granite:data & listeners to trigger servlet.

as mentioned below, you can set the class or identifier to invoke method when content loads.

<granite:data
   jcr:primaryType="nt:unstructured"
   dd-showhide-target=".show-hide-field"/>

JS.

the foundation-contentloaded will be triggered whenever dialog opens

(function (document, $, Coral) {

   "use strict";

  $(document).on("foundation-contentloaded", function (e) {

$(".class", e.target).each(function (i, element) {

   var target = $(element).data("data-fld-class");

   if (target) {

  Coral.commons.ready(element, function (component) {

// write you logic

}

});

})(document, Granite.$, Coral);

More details :

Listeners implementations in touch UI.

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

Thanks!

Arun_Patidar
Community Advisor
Community Advisor

Hi,
What is your use case?
You can invoke servlet using Ajax request. for example on text field change, you can write jquery event listeners, which will be executing js code and invoking servlet.