How to refresh the data panel content after a DataFile.copy() call?

How to refresh the data panel content after a DataFile.copy() call?

ltomuta
Advisor Advisor
428 Views
3 Replies
Message 1 of 4

How to refresh the data panel content after a DataFile.copy() call?

ltomuta
Advisor
Advisor

I'm copying a file to the active data folder using DataFile.copy and it works great but the Data Panel does not show the new file. Even if I open it through the API and then save a change it still does not "dirty" the data panel so a refresh is not triggered.

Data.refreshDataPanel() is not a good option as it also resets the active folder and returns to the root level.

0 Likes
429 Views
3 Replies
Replies (3)
Message 2 of 4

kandennti
Mentor
Mentor

Hi @ltomuta .

 

I changed it to offline and went online again and it updated and showed up here.

        app.isOffLine = True
        app.isOffLine = False
Message 3 of 4

ltomuta
Advisor
Advisor

Clever trick. I will try it.

0 Likes
Message 4 of 4

ltomuta
Advisor
Advisor

It works but it has side effects, e.g. opening the file immediately after fails ("fail to download file").
Probably listening for offline status change events and then opening the file only after online mode restored would be the proper way to deal with this problem.

For now I rather not copy the file and rely on the user using Save As ... to put the file there it belongs after changes.