Navigating within the same view - updating URL parameters

Hi Guys. I am trying to achieve loading of a data object based upon a URL parameter. That works great when you enter the view, but what if I want to navigate to the same view again with different URL parameters? The On View Load only triggers the first time.
To sum up: Is there a way to trigger an event in the view when you navigate to the same view with different URL parameters? Or am I approaching this from the wrong angle?
Any feedback is appreciated :slight_smile:
Øystein

Hi. In what way are you navigating to the view? If you open app-settings you could trigger the action on app-load or on browser history change which might do what you want.

However; another approach is to use URL-parameters as a filter for database-connected datasources so that this filter-update would happen automatically.

Hi Karl and thank you for the reply. I am not entirely sure what you ask here. Let me try to elaborate:
In the view, I am showing a “Deal”. The Deal shown is loaded by fetching the Deal ID from the URL parameter “deal”. Within that view is a possibility to view another “Deal”. When I click on that item, I am running an action navigating to the exact same view, but with different URL parameter values (deal URL parameter). The cleanest way I imagine, would be that when I trigger the “Navigate to” action, some kind of event would trigger somewhere so I could great an action to load the other “Deal”. The “On View Load” only triggers the first time the view is loaded as far as I can see.
Hope that made more understandable…
Øystein

Alright. To give you a good answer I would like to confirm if the datasource you are using is a runtime datasource or if it is db-connected?
If you are using URL-parameters the cleanest setup would be to use a db-connected datasource where you set cardinality to “one” and filter the datasource based on the mentioned URL-parameters. You could set up the URL-parameter to either use type “deal” or a string and filter it on the built in property random identifier.

If you want to use a runtime datasource instead and trigger an action to fetch the object I think the “on browser history change”-trigger would be what you need.

Awesome! Just what I needed. It’s the runtime datasource evaluation type I need to work on.
Thank you :slight_smile:
Øystein

1 Like