how to differentiate Between 2 identical action
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello All,
I have a problem with default component ,if i have 2 of same component in the custom component they both fire the same action with the same payload so i can not tell the difference between them
Example:
import { createCustomElement, declarativeOperations } from '@servicenow/ui-core';
import snabbdom from '@servicenow/ui-renderer-snabbdom';
import '@servicenow/now-toggle';
const view = (state, { updateProperties, updateState }) => (
<div>
<now-toggle data-field="email" id="masadjaskld"/>
<now-toggle data-field="notifications"/>
<button on-click={e => updateState({
path: 'math',
value: 2,
operation: declarativeOperations.SET
})}>Hello !</button>
<p>{JSON.stringify(state)}</p>
</div>
);
createCustomElement('my-element', {
renderer: { type: snabbdom },
view,
properties: {
name: { default: 'Fred' }
}, setInitialState() {
return {
animals: {
cats: 1,
oo: { mn: "rec" }
}
};
},actionHandlers:{
'NOW_TOGGLE#CHECKED_SET': {
effect(coeffects
) {
}
}
}
});
I tried by DOM variables but i can not get the DOM element from the action
0 REPLIES 0
