Refresh whole page including archives

lock
push_pin
done
Beantwoord
5

Hi,

We use the following snippet a lot to refresh the page when we have performed some changes (for example, with a task menu dialog):

 eventData.setNavigateTo("soprotocol:main[refresh=true]");

I have noticed that this does not refresh the archives of an entity (anymore), not sure if this is due to the new UI.

My assumptation is that this should also refresh the archives of the page (atleast the one currently active), but since you are explicity setting main in the soprotocol, I am not completely sure?

So is this intended behavior? (in that cas, how to refresh the currently active archive?) or a bug

21 feb 2025 | 10:09 a.m.

Alles Antwoorden (5)

Hi David, 

The idea that it used to refresh the archives and doesn't anymore seems like a corrective action from previous version. 

SoProtocol is a navigation declaration that expects a where and what (soprotocol:{{WHERE}}[{{WHAT}}]?{{WHO}})

Another way to look at it is:

soprotocol:target-screen.upper-tab.lower-tab.mini-card?who_id=#

Only declaring main as a target means it should only target the main upper card view of the current page, none of the archive cards. See the targets page. FYI, you should idealy specify the target-screen too.

 

 

26 feb 2025 | 11:32 a.m.
Hi Tony,

According to this input - is it still possible to do the following?

1) Refresh main card (yes)
2) Refresh 'currently/last used archive' on a user level - related to main entity/main card

Because that's what most of us (I think) would expect from the soprotocol:main[refresh=true] logic.

If you specify the archive in the soprotocol-link, you potentially redirect the user to an archive they weren't looking at (which sometimes can be useful, but also sometimes/often is not relevant, thus it would be preferred to simply refresh 'current archive' along with main card)
26 feb 2025 | 12:31 p.m.

Hi Tony,

Thanks for the response, so if I want to refresh the current view of the user, how do I know which archive tab is currently open? I don't see an option for that in the ViewStateAgent.

26 feb 2025 | 12:32 p.m.
Assuming the script is executing in an Entity trigger, you know which entity the event was triggered from. Same goes for task menu items.

That said, you never really know what the selected view actually is, i.e. main, udef, interest, etc. This seems like an opportunity for improvement.

Would it be useful to get the the view state in the EventData too? If so, sounds like a reasonable request/wish.
26 feb 2025 | 04:34 p.m.

View state in the event data or as method on the ViewState agent would be great, that way we can construct the soprotocol to refresh the correct parts.

26 feb 2025 | 04:35 p.m.

Reply toevoegen