I'm developing a perspective view (Ignition 8.1.23 (b2022121308)) where I need to get the url query parameters, which will be sent to SQL Server for further elaboration via named query. I've created a custom property
queryParams on the view, whose binding I've set to
page.props.urlParams. Unfortunately I'm experiencing the following issue: when the page transition is caused by an item click on a
Menu Tree component whose
target property is set to a relative path (e.g.
/trend?tag=[default]myTag&trendType=1) the view
queryParams custom property does not get updated with the new url query parameters. Next I press F5 and the custom property
queryParams gets updated correctly. If the Menu Tree item's
target property is configured with an absolute path (e.g.
http://<gateway_address>:8088/.......) then a new browser tab is opened and the view
queryParams custom property is correctly reporting the new
page.props.urlParams. To further investigate, I set a
text property on the view to
page.props.urlParams and I experienced the same issue: the label does not update with the new
page.props.urlParams value, unless you press F5 or you input the address directly in the address bar.
Is that an issue or am I missing some important parameters?
Thanks in advance, regards
Just read the bottom note at the following help page:
Maybe that's the answer
Indeed, I believe this is the reason.
So how to work around this ? Depends on exactly what you're trying to achieve, but the answer will probably be either
Can you describe with more details and examples what your goal is ?
Hallo @pascal.fragnoud, thanks for your answer. I'm thinking to set the
target property of the menu item to a null string, so that the menu item won't activate a page tansition. Instead I will use the
itemClick event, where I will gather all the parameters I need and activate a page transition through the
system.perspective.navigate function - according to the user manual, that is the only instruction that will cause Ignition to assign
There might be more appropriate ways than the url to pass the required data.
But we can't say until we have more information about your use case...
From what I gather so far, it looks like you have a page where data is collected, and this data is then sent through the url to another page, that will use that data to send a query. Is that correct ?
If so, I really, really think that there must be a better way.
To sum up: all the Menu Tree items points to the same page. On that page I show the trend of the tag which the operator selected with the menu tree item click. I think that passing the tag name as a URL query parameter is the quickest way, provided that it works .. and indeed it doesn't, because of the
I suspect you're not using the powerchart because you want to control the tags that the user can see ?
In that case, why not just put a dropdown on the page where your chart is ?
Is the menu still available on the chart page ?
Is there something else that needs to be passed (I see a
trendType=1 in your first post) ?
What are the constraints and requirements for this ?
I need the menu tree structured view, because the tags must be grouped into areas, sub-areas, sub-sub-sub and so on. And yes, I need to pass some more information.
How about using the
onItemClicked event to change the tagpath directly on your charting component, instead of navigating to a new page ?
Or is there a reason you need to navigate to a new page ?
Somehow is what I'm going to do. Navigation is needed because the menutree is in a left docked view and the very first view won't be the trend view, but a welcome view or anything else.
Then you can probably use view navigation instead of page navigation, which would allow you to pass view parameters instead of url parameters.