Skip to main content
naresh5361
Level 2
Dez. 19, 2022 9:11 PM UTC
Beantwortet

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.

Dieses Thema wurde für Antworten geschlossen.
arunpatidar
Community Advisor
Dez. 20, 2022 8:29 AM UTC

3 Antworten

SantoshSai
Community Advisor
Community Advisor
Dez. 19, 2022 11:39 PM UTC

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

Übersetzen
Santosh Sai
naresh5361
Level 2
Dez. 20, 2022 3:51 AM UTC

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.

 

 

Übersetzen
arunpatidar
Community Advisor
Community Advisor
Dez. 20, 2022 8:29 AM UTC
Arun Patidar