Hi,
I'm learning AEM. I would like to know, is there a way to manipulate(perform string operation) the text that we get from the author dialog window and display the manipulated string in the same field. So that the author could see the manipulated text the next time he opens the dialog(without any additional event listeners).
For example, if the author inputs google in the text field and closes the author dialog window - when the dialog window is opened for the next time, the text should be something like google.com instead of just google.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @JAI_AEM
you can add the .com using sling model in the getter method but it is only displayed in the component property. but you can't see the google+.com in your dialog. I remains the same (google) in your dialog.
thanks.
Hi @JAI_AEM ,
You can achieve this in the component sling model class. Inject the required property in sling model and update its value using setProperty in its init() method.
Hi @JAI_AEM, if you want to change value of property set via dialog by author, than in my opinion SlingPostProcessor [1] will be the right thing to use.
[1] - https://sling.apache.org/apidocs/sling5/org/apache/sling/servlets/post/SlingPostProcessor.html
Hi @JAI_AEM
you can add the .com using sling model in the getter method but it is only displayed in the component property. but you can't see the google+.com in your dialog. I remains the same (google) in your dialog.
thanks.
Hi,
You can use javascript to change the authored content on dialog save event.
1. create a clientlibs with category of cq.authoring.dialog
2. write a listner on save
3. read/change the content and set the value
$(document).on("click", ".cq-dialog-submit", function (e) { //$(window).adaptTo("foundation-ui").alert("Close", "Dialog closed, selector [.cq-dialog-submit]"); });
check below article for example
https://aemsimplifiedbynikhil.wordpress.com/2018/07/30/touchui-dialog-listeners-aem-6-3/
Views
Likes
Replies