# Perspective Map Component, popup doesn't update

**URL:** <https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 18, 2022, 1:13pm UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301 "2022-02-18T13:13:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![LucaL](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@LucaL](https://forum.inductiveautomation.com/u/LucaL)\
**Post date:** [February 18, 2022, 1:13pm UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/1 "2022-02-18T13:13:55Z")

</div>

Hello everyone,

I’m facing in a problem about the data update once I open a Popup related on a marker in Map component.  
I’ve a map with some markers and when i click on one of them it appears a popup with a status led. The status is fetched trought a named query. This step works, but when I close the popup and I reopen it, seems it’s already open and it doesn’t fetch the updates data from the DB.  
The Named query hasn’t checked the flag on caching result as well as the binding query doesn’t foreseen the cachin result.  
Does anyone can help me?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/2/52e8f32e0fc781e1ec53a2d1c5f48c0a02a52203.png)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 21, 2022, 7:31am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/2 "2022-02-21T07:31:20Z")

</div>

There are some bugs related to viewparams in popups across the versions.

Update and move your query to a custom param. And turn off (input/)output on your viewparams, a popup should not have output params

---

<div class="post-metadata">

**Author:** ![LucaL](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@LucaL](https://forum.inductiveautomation.com/u/LucaL)\
**Post date:** [February 21, 2022, 8:09am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/3 "2022-02-21T08:09:59Z")

</div>

Hello Victor,

thanks for your reply, unfotunatly nothing has changed.  
I’ve set the params as custom property but the query has performed just one time once the popup has been opened.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/9/99d1cdd1f3df6cd0109c7ea8d05954f2d1fc8adf.png)

The params ID\_SENSOR has been passed from the Map component once the user click the icon marker on the map, it should be a input params  
Any other suggestion?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 21, 2022, 8:20am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/4 "2022-02-21T08:20:03Z")

</div>

can you confirm the id has changed?  
try putting an onchange script on the viewparam ID\_sensor with something like (and maybe log it to confirm it changes):

`self.refreshBinding('custom.ITEM_DB')`

---

<div class="post-metadata">

**Author:** ![LucaL](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@LucaL](https://forum.inductiveautomation.com/u/LucaL)\
**Post date:** [February 21, 2022, 8:50am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/5 "2022-02-21T08:50:23Z")

</div>

I’ve already set a log to understand the behaviour, and if I click on a marker it trigger a log on a Chrome console:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/96e7c3835b70d7558b4c34d334342a84dce2edd5.png)  
The map has (dev status project) just 3 markes and once i’ve open the marker with the lamp if i reopen it does’t refetch the data from DB. I’m simulating the switch status from the DB table but it doesn’t change  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/0/c0dd347c3b60e4c7af592f18985791939dcbefdc.png)  
A bad solution should be polling the DB every 5 seconds but it will be the last soution to consider

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 21, 2022, 9:07am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/6 "2022-02-21T09:07:55Z")

</div>

i dont understand what is being printed there xd  
Does the onchange script trigger when you reopen the popup

---

<div class="post-metadata">

**Author:** ![LucaL](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@LucaL](https://forum.inductiveautomation.com/u/LucaL)\
**Post date:** [February 21, 2022, 9:28am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/7 "2022-02-21T09:28:34Z")

</div>

Sorry, I wrote the Log in Italian XD, anyway I set the trigger into onChange script and as you can see it’s fired just one time, if I want to reopen it seems the popup it’s been cached or it is opened in background.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/23141eb89aa1f3606385f29443d01b4cb432af16.png)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 21, 2022, 10:55am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/8 "2022-02-21T10:55:05Z")

</div>

how do you open the popup?

---

<div class="post-metadata">

**Author:** ![LucaL](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@LucaL](https://forum.inductiveautomation.com/u/LucaL)\
**Post date:** [February 23, 2022, 9:30am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/9 "2022-02-23T09:30:29Z")

</div>

I open the popups through the Map component. if i click on the marker it opens the popup automatically

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 23, 2022, 9:47am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-popup-doesnt-update/56301/10 "2022-02-23T09:47:40Z")

</div>

Ah i did not know it was within the map itself, havent really used that component yet xD  
I have no idea then how it works
