App ID: ACE46687-EB31-F095-FF38-CDB1E0260900
Screen with issue: All_Contacts_View
After converting some objects to be reusable: (ContactListsComponent on this page) the logic still works on the page, but if you try to edit the logic on the on click handler for that icon (shown), there appear to be errors with some blocks.
It doesn’t make sense that UI-Builder states that they’re errors, and won’t save the code, but the code still works correctly!
Click on the icon shown in the image, then look at the code in the “On Click” handler.
Here’s the logic:
I don’t know how to fix this because it’s difficult to understand the “scope” of how reusable components work, and what their limitations are.
It’s working now, but if it’s changed and saved, I’m guessing that it will be broken forever.
Please advise if this is a bug, or how this can potentially be fixed.
When you convert a component with all its children into a reusable component it creates a new logic context.
It means when you edit a logic of a component inside a reusable component you do not have access to any components outside the component because the reusable component can be used on different pages.
In order to fix it, you need to replace all problematic blocks
The errors in the logic are going the other direction – from the page, to the component.
I need to access a data block inside the component to store a dataset that the reusable component uses for its data.
There are no options in the (error) data block for changing this to the data block INSIDE the component.
you can enable
Data Container option for the component (edit UI of the Component → select the root → to enable the option)
and then you will be able to use the Component Data model for setting data inside the component from a page
I already tried this, it does not work for the Repeater Data Block.
The only choice is “ContactsContainer” – There’s not a choice for “ContactsListComponent1”, which is what the Reusable Component is named inside the page.
I reverted it back to what it was before.
I’ll experiment with reusable components later when I have more time.