I have two field in dialog - Pathfield / HTML5SmartImageField .
From Pathfield, i will select one page which would be having one image.
Now what i want is - once i select page from pathfield , that image will automatically rendered on my smartimagefield.
I used dialogclose listener to listen the pathfield, once the page got selected my dialogclose event listener JS would be called.
In that JS, i want to make call ajax to call servlet.
From that ajax, i would pass path of the page selected from pathfield to the servlet. In that servlet, i would manipulate that path and will get that image path from its JCR property.and then plan to return back to ajax on success.
But I dont know can i make ajax call from Listener JS?
If possible , please provide me some reference for this in which we are calling servlet in listener JS
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
Please have a look at these helpx article:
Link:- https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
// Submitting Adobe Experience Manager form data to Java Sling Servlets
Here we are cresting a custom sling servlet, that we will be calling from jquery AJAX call.
$.ajax({
type: 'POST',
url:'/bin/mySearchServlet',
data:'id='+ claimId+'&firstName='+ myFirst+'&lastName='+ myLast+'&address='+ address+'&cat='+ cat+'&state='+ state+'&details='+ details+'&date='+ date+'&city='+ city,
success: function(msg){
var msgId= json.id;
var lastName = json.lastname;
var firstName = json.firstname;
$('#ClaimNum').val(msgId);
$('#json').val("Filed by " + firstName + " " + lastName);
});
});
Here we are submitting the data, but we can also return the data as well.
I hope this would help you.
~kautuk
Views
Replies
Total Likes
See this AEM community artilce - it will point you in the correct direction:
http://scottsdigitalcommunity.blogspot.ca/2014/03/creating-aem-component-that-uses.html
Hope this helps....
Views
Replies
Total Likes
Hi
Please have a look at these helpx article:
Link:- https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
// Submitting Adobe Experience Manager form data to Java Sling Servlets
Here we are cresting a custom sling servlet, that we will be calling from jquery AJAX call.
$.ajax({
type: 'POST',
url:'/bin/mySearchServlet',
data:'id='+ claimId+'&firstName='+ myFirst+'&lastName='+ myLast+'&address='+ address+'&cat='+ cat+'&state='+ state+'&details='+ details+'&date='+ date+'&city='+ city,
success: function(msg){
var msgId= json.id;
var lastName = json.lastname;
var firstName = json.firstname;
$('#ClaimNum').val(msgId);
$('#json').val("Filed by " + firstName + " " + lastName);
});
});
Here we are submitting the data, but we can also return the data as well.
I hope this would help you.
~kautuk
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Like
Replies