A bit obtuse this one. When using a reusable element, is there an effective way to set the state of an element by the group that the reusable is inside?
I have a single window that opens and the text it displays (and columns data is saved to) changes based on the state of the window.
If I have multiple separate buttons, that’s fairly straightforward to accomplish, but I’m trying to use more reusable elements, and to retain my current functionality, I need to set the state of the window as it opens.
From the workflow, I can’t see a way to loop in state change from an external element. What I want to achieve is for the reusable element to push a different state to the window depending on which element was clicked.
A reusable element can not make changes to elements that are not in the reusable element. However, a reusable element can be altered by the elements the reusable element is placed in.
But you can make an element that is not in the reusable element react to changes in the reusable element…so for example, if a reusable element has buttons, and they get clicked you can set a custom state onto the reusable element…then on the element that is not in the reusable element, but is on a page where the reusable element is, you can have a conditional to change something about the element based on the value of the custom state of the reusable element.
The window that is opened by the reusable element is a part of that element, so it should be possible, but what I’m struggling with is how to change the state of the window through the workflow.
Put another way, if I line up 4 instances of the same reusable element, that all open the same window when clicked, how do I make it so each instance gives the window a different state?
By 4 instances of the reusable element, I assume you are referring to using the the reusable element 4 different times, which could be on different or the same page.
In that event, you can have a Property on the reusable element, set to whatever type of data it is needed to be (in the reusable itself)…then for opening the window, you can use the dynamic expression to reference the reusable elements’ property value.
Then when you place the reusable element onto the page, you can set the property value to a data value.