Hi,
I want to set in my application a reusable header for popups that will contain a title. I want to set the text of the title when I open the popup. If I add the title as a text element, I can edit it in the reusable element, but when I pull the reusable element in a page, that text is not editable any more. I got to thinking that I might use a state that I set in the reusable element and when I open the popup set that state to a certain value and assign that value to the popup title. I was not able to implement that. I also tried setting the text value from an option set - I can do it when editing the reusable element but not when I insert the reusable element in a page.
Is there a way to modify content in a reusable element when you use that reusable element in a page?
Thanks!
You can use reusable element’s data source as a text or you can add a property to that reusable element. For example you can add a text property X and you can set this X’s value different on page A or page B. Here are some SS’s about the case.
Thanks @batuhanmerguz
I can set the text property in the reusable element. I can then set the text element to take the default value of that property. When I open the popup in a page, I see the default value.
I do not know how to change that value when I open the popup in a page. I expect that I need to use an element actions, but the available actions do not include set value. What action do I use?
I think I understand. If you using popup in a reusable element, you need to “Show Popup” on this reusable element or if you need a trigger on other side for example a page, you can set a custom event in the reusable for showing related popup and after that you can trigger that custom event from page with “Trigger a custom event from a reusable element”.
If this one also won’t work, you can send a page parameter when you click that button on a page. Therefore you can show popup with related page parameter’s conditional.
I hope these solutions will work for you. Please let me know if there are any blank points.
Thanks @batuhanmerguz ,
I am still not getting it. Let me try to simplify it. I have a reusable element that contains a single text element. The default text says DEFAULT. I want to show this reusable element in a popup. I want to change the value of the text in the reusable element when I open the popup. The popup is not reusable. So, in popup 1 it reads POPUP ONE, in popup 2 it reads POPUP TWO. I expect to be able to set the desired value when I open the popup. Is this possible?
Yes it is possible. You will set the type of content for the popup same as the reusable element (which is text). Then, when opening the popup, you will call Display Data in Group/Popup action and pass the data you want to display to the popup while opening it. Then, the reusable element in the popup will have data source of Parent's text.
Set the Type of content of the reusable element to text.
Set the value of the text element to the reusable element’s (DATA SOURCES) text.
Insert the reusable element in a page (or in a popup in a page).
Set the Data source of the inserted reusable element to the desired value. It can be a manually typed text or an option.
If I want to use the reusable element in a popup and change the value when opening the popup, I can do as suggested by @hergin (thanks): set the desired value through the Display Data in [the desired reusable element name] action.
This is utterly unintuitive. In the reusable element, you set the type to text in step 3, but when you are using the reusable element, in step 6 you are not setting the text but the Data Source. Also, you are setting the parent element’s type to text and then this type is shown as a Data Source in step 4. That is, there is some hidden internal info in bubble. Similarly in step 7, it is not evident why the Display Data action works - the Ui suggests that you are displaying data in the reusable element, there are no indications that you are setting the reusable element’s text or Data Source.
I do not understand the need for these inconsistencies.