Accessing an embedded View in another Perspective view folder (Component Methods)

Hello everyone,


I have an event script triggered when 'button' is clicked. The script is suppose to assign a path to EmbeddedView which is in another folder. How can I go about this? The following doesn't seem to work:
self.parent.parent.getSibling("Users_Management").getChild("Flex_View1").getChild("EmbeddedView").props.path = "Admin Folder/Flex_View2"

The script is suppose to assign a path to EmbeddedView which is in another folder.

If clicking the button also opens Flex_View1 then use parameters:

  1. Create a parameter on Flex_View1, embeddedViewPath.
  2. On the Embedded View component, create a Property Binding on props.path and set it to view.params.embeddedViewPath.

If not, (because the view is already open, for example) then consider using a session variable:

  1. Create a session variable, embeddedViewPath.
  2. Modify the script to update the session variable with the correct path.
  3. On the Embedded View component, create a Property Binding on props.path and set it to session.custom.sessionViewPath.

If you are trying to build user management into your application then I highly recommend the Perspective User Management project available on Exchange below.

"Siblings" in this context means "component" - NOT View.

Your provided View hierarchy doesn't suggest you have an Embedded View placed within Flex_View1. So this is your first step.

  1. Place an Embedded View into Flex_View1.
  2. Modify your script to be this:
self.getSibling("EmbeddedView").props.path = "Admin Folder/Flex_View2"