Poppulate dialog fileds on the page properies based on the response of the servlet. | Adobe Higher Education
Skip to main content
naresh5361
Level 2
December 19, 2022
Répondu

Poppulate dialog fileds on the page properies based on the response of the servlet.

Hi All,

 

I have a requirment like, when we select a value in drop down a servlet call will be triggered and based on the respone of the call I have to show th fields on the page which are dynamic and when we reedited the page it has to dispaly previous selected data as well.

Can anyone suggest how can we achive this. 

 

Thanks.

Ce sujet a été fermé aux réponses.
Meilleure réponse par arunpatidar

Hi,

You can check this if helps

https://aemlab.blogspot.com/2022/01/aemaacs-touch-ui-dialog-dynamic-dropdown.html 

2 commentaires

SantoshSai
Community Advisor
Community Advisor
December 19, 2022

Hi @naresh5361 ,

You can achieve this through ajax call along with custom JavaScript based on dialog ready, which is responsible to get response from servlet. 

some sample code snippet as below

<script> $.ajax({ type : "POST", url : '/bin/submitdata', /*data : { pass your request parameter here, currently we are not passing any data },*/ success : function(data, textStatus, jqXHR) { //write your logic that you need to perform on sucess }, error : function(XMLHttpRequest, textStatus, errorThrown) { //write your logic that you need to perform on error } }); </script>

Also please go through below link: https://www.youtube.com/watch?v=H3xV4S8aq5k

Hope that helps!

Regards,

Santosh

Santosh Sai
naresh5361
Level 2
December 20, 2022

Hi @santoshsai ,

 

I want to show dialog feilds based on the servlet response.

Example below :

{
"property-title1":  {
"checkbox": "value",
"checkbox": "value"
},
"property-title2":  {
"checkbox": "value",
"checkbox": "value"
},
"property-title3":  {
"checkbox": "value",
"checkbox": "value"
}
}

I have to show like below.

property-title1 

  •  title
  • name

property-title2

  •  title
  • name

this json is coming from servlet respone and this data is very huge and dynamic. i want this to be dispalyed when we select some value in dropdown.  

hope you understand. 

 

thanks.

 

 

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorRéponse
Community Advisor
December 20, 2022