- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2022 07:19 AM
I have created a custom component and I want to trigger an event in that component from the UI Builder. Is it possible to call that event? I tried api.emit('EVENT') in a client script but that didn't work.
Otherwise I would have to watch a property? But not sure if that's even possible?
Solved! Go to Solution.
- Labels:
-
Now Experience UI Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 05:46 AM
Ahh so components are built as properties in and events out, so I would expose a property that you want to monitor and then use your event in UIB to change a CSP you've bound to that property in UIB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2022 06:31 AM
Just found about COMPONENT_PROPERTY_CHANGED and this seems to tie it all nicely together.
So basically, property changes and this can be "watched" to react on it.
[COMPONENT_PROPERTY_CHANGED]({dispatch, action: {payload: {name, value, previousValue}}}) {
if (name === 'property_name') {
dispatch(EVENT);
}
},

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2023 11:36 AM
@Philippe Luickx It's aIso possible to listen for property changes by declaring the property this way
mapItemMarkers: {
default: DEFAULT_VALUES,
onChange(currentValue, previousValue, dispatch) {
dispatch(customActions.INITIALIZE_MAP);
}
}
PS: I am also building a custom map component.