- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2020 02:17 PM
Hello community,
I'm trying to open a custom component in a Modal window in Agent workspace through a UI Action, you can actually do that as per the docs to use a custom component and call g_modal in a UI aciton to render your component. I have followed the steps in the docs as per below link, just you may need to add admin role to the ACLs in the table sys_aw_registered_scripting_modal 😉
However, I would like to control the buttons in the modal window or pass along some data back from the custom component to the modal window or being able to control the modal from my custom component.
Basically , In my custom component I want to list some categories and base on what is selected to pass back those values to the form, I can pass the g_form object as part of the params values when invoking the g_modal. However, I would like to return or pass this data selected in the child component to the modal component so once the user clicks the button I can validate this in the UI action rather from the child component, I want to avoid using g_form in my custom component and instead to pass values to it. Another approach I was thinking of is to hide the modal buttons and instead use the buttons from my custom component and be able to close the modal popup from the custom component. Sadly I'm not able to find how to disabled buttons in the modal or pass some reference to my custom component to close the modal. Seems that g_modal has not much information about what options can be configured or pass to it.
Something to mention is that I can pass some parameters to my custom component by specifying those in the params object, think of params as your properties object 🙂 , as per below example:
g_modal.global.showTemplate({
title: 'Response Template',
//confirmTitle:'Copy',
params: {
secondaryItems:{},
table: g_form.getTableName(),
sysId: g_form.getUniqueValue(),
gForm: g_form
}
}).then(function(result){
console.log(result)
alert('confirm:'+result);
}, function(error) {
console.log(error)
alert('cancel:'+error);
});
Solved! Go to Solution.
- 25,580 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 12:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 07:42 AM
Try this page: https://www.ashleysn.com/post/workspace-ui-actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 11:50 AM
Broken link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 12:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 11:50 AM
Broken link
