Can you transfer a data field between views?

Good morning,
Our customer would like to select a site/location of machines and then view information on that site’s machines. I have a menu of different views of data (graphs, data table, charts, etc). I has hoping they could select a site and then be able to go to different views without having to reselect the site on each view.

Hopefully this makes sense to y’all.

Thanks!
Willi

Store your selection in a custom session property. Bidirectionally in the view that sets it. Reference that property everywhere else. Or, perhaps, in a page property, depending on how “global” you want it to be for your users.

2 Likes

As @pturmel suggests, you are describing a session scoped variable in that the data is used outside of just the view. So you should definitely use a session property, and any view which would need access to this data should then reference the session property.

1 Like

Wow, thanks for the quick replies!

But, perhaps I should back up a tish. First, I am not trained in Ignition but was a VB and Oracle programmer. I know what I would do in VB but this is definitely different!

On my view, I have a drop down that lists the sites (ddStartLocation). I want to take the site to be used in other views. So, is my first thing to take the selected site from the drop down and move it to a text field (txtStartLocation)?
And would that all happen using the event mouse click of the drop down?
And then would that text field be the custom session property variable? I don’t know how to set that up.

Sorry for the serious hand holding here.

I’ll walk you thorugh this, but before you develop any further I strongly recommend you make use of the free Perspective University video pertaining to Perspective.

Steps:

  1. Click the Perspective/Views directory in the Project Browser of your Designer.

  2. If you do not see the Perspective Property Editor panel displayed, you might need to turn it on by using the Designer’s menu bar, under View > Panels > Perspective Property Editor.

  3. With the Perspective/Views directory selected, the Perspective Property Editor should be displaying all of the session properties. By default the props area has many properties of the current session. These are often read-only; you will not be adding any properties in this area.

  4. Scroll down in the Perspective Property Editor until you see a category of “SESSION CUSTOM”.

  5. Click “Add Custom Property” and select “Value”.

  6. You should now see a key:value pair.

  7. Edit key to be a property name which makes sense for the site to be used in the session. I suggest session_site. You should also edit the value of this property to some sort of default value which makes sense for your project. What value do you want to use up until a user selects a site from the dropdown?
    Screen Shot 2021-10-13 at 1.20.38 PM

  8. Now with the session custom property created, your Dropdown should use a bidirectional binding against that session property.

  9. Select your Dropdown component within your View.

  10. In the Perspective Property Editor, hover over props.value. Click the “link” icon to the left of the property.
    Screen Shot 2021-10-13 at 1.22.49 PM

  11. In the resulting dialog, select the “Property” binding type.

  12. To the right of the text field presented under “Configure Property Binding”, click the menu/list icon, then expand the “session” level, then expand the “custom” section, and finally select “session_site”.
    Screen Shot 2021-10-13 at 1.26.08 PM

  13. Set the “Bidirectional” checkbox to a “selected” state.
    Screen Shot 2021-10-13 at 1.26.17 PM

  14. Click “OK” to save your changes.

  15. The Dropdown may now be used to modify the session property in real-time.

2 Likes

Wow! Thanks for all your info. I have reviewed IU videos but the terminology is so different from what I’m used to. We just defined variables as global. When y’all explained it, it made total sense. Ignition is different from what I’ve used in the past. Last thing I was working on was SAP in the defense company I worked for before I retired.

I’m helping out my husband’s engineering student’s senior project. First it was just the code and now it’s grown to more. But, I don’t mind. I get to code which I miss.

I can’t thank y’all enough!

-Willi