Question

How can I retrieve data page results in Javascript ?

Hi,

I am implementing custom html in order to use customized Here Maps Javascript API. I need to get latitude and longtitude by a data page. Is it possible to get data page results in JS ?

Thanks.

Correct Answer
July 18, 2019 - 11:30am

I achived my goal by below code;

  1. <script type="text/javascript">
  2.  
  3. var current="";
  4.  
  5. <pega:forEach name="D_.pxResults">
  6.  
  7. <pega:withEmbedded name="$this" >
  8.  
  9. current="<pega:reference name=".Property" />";
  10.  
  11. </pega:withEmbedded>
  12.  
  13. </pega:forEach>
  14.  
  15. </script>

 

Comments

Keep up to date on this post and subscribe to comments

July 5, 2019 - 11:16am

Hello,

I haven't tried anything like this in a very long time, but can't you put the properties into your section somewhere that isn't actively displayed so that you have an object in the DOM you can point at with your JavaScript?

Thanks,
Mike

July 8, 2019 - 1:47am
Response to MikeTownsend_GCS

Hello,

I did think about it. But there are 30000 rows in data page results. So I don't think that I can store whole values in a property.

Thank you for your answer.

July 11, 2019 - 11:16am

I can display the results using jsp tags (pega foreach). But I need to store the results in a javascript array. Is there anyone who has implemented this scenario before ?

July 18, 2019 - 11:30am

I achived my goal by below code;

  1. <script type="text/javascript">
  2.  
  3. var current="";
  4.  
  5. <pega:forEach name="D_.pxResults">
  6.  
  7. <pega:withEmbedded name="$this" >
  8.  
  9. current="<pega:reference name=".Property" />";
  10.  
  11. </pega:withEmbedded>
  12.  
  13. </pega:forEach>
  14.  
  15. </script>