System.perspective.navigate() can not pass params in 8.0.3

when I use system.perspective.navigate ,I can’t receive the params in the navigated View.
the code is like this:
system.perspective.navigate(view = ‘Page/TabView’, params ={‘myParam’:1,‘myParam2’:‘Test’})

the tabview page has been navigated, and the same params are defined in the ‘Page/TabView’, but I can’t get any params.

can anyone help me ?

A couple of things to check in your environment:

  1. Make sure the ‘Page/TabView’ View indeed has the case-sensitive params “myParam” and “myParam2”.
    45%20AM
  2. Make sure that something in the ‘Page/TabView’ View is bound to those params, otherwise you might be receiving the parameters without displaying the results.
  3. Make sure you’ve saved the Views in question.

Using the following steps, I was able to see that I had navigated to a View while supplying parameters:

  1. Make two Views - ViewA and ViewB.
  2. Place a button in ViewA with the following Script Action invoked as part of an onClick Event system.perspective.navigate(view='ViewB',params={'myParam':1,'myParam2':'Test'}). The View path is based on the View we’re navigating to being located in the base directory (there is no fault in the path supplied in the original post, assuming a structure of “Perspective/Views/Page/TabView”).
  3. In ViewB, create two parameters, “myParam” and “myParam2”, and set their values to be 0 (just so we can see that they’ve been changed).
  4. In View B, place two Label components, binding each one to a different parameter value.
  5. Save the Project and navigate an open Session (NOT in the Designer) to ViewA.
  6. Click the button.

If you’ve followed similar steps and the parameters are still not working, could you supply the build number you’re using? My build is from 6/27, so if something changed in a recent nightly I would need to take a newer build to be 100% sure nothing has changed.

thank you . I follow your step and success:grin:

Found this helpful. Had to use the system.perspective.navigate(view = ‘ViewB’…) instead of the url being navigated to.

does this work the same for syste.perspective.navigate(page=....) ? I have done exactly the same as you described trying to send parameters with page navigation and I dont succeed . it navigates but it doesnt pass the parameter values !

You're going to have to give us more information. Obviously you've got something wrong but we can't see what.

1 Like

so I am trying to do a page navigation and send in title parameter as well.
I did system.perspective.navigate(page='myPage',params={'title':'bla'}).
However I realize my parameter is on the view associated with myPage so I guess that is why it doesnt get passed to the page .

Navigating to a page (as opposed to a view) should be handled via URL parameter passing. Your page URL will need to be configured with those parameters

1 Like

There's a couple of ways to pass parameters to pages. The Page Config param passing route linked above is one way.

You could also pass them via the conventional query params route. In your scenario, you would use the following approach:

system.perspective.navigate(url=self.session.gateway.address + "/data/perspective/client/" + system.perspective.getProjectInfo()["name"] + "/" + "myPage" + "?title=bla")
1 Like