How to create a custom modal button which will trigger the Save button on an embedded Form widget

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2018 06:20 AM
We embedded the Widget Form on a modal on service portal. Our goal is to create a custom "Submit" button so that when clicked, it will save the changes made on the form and then close the modal. Of course we need to hide that original save button so only our custom buttons will show.
How can we call the "Save (Ctrl + s)" button's function and do it via our custom "Submit" button instead?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2018 10:47 AM
I think this part is the problem:
ng-mousedown="triggerUIAction(getPrimaryAction())
Believe since this is tied to a mousedown event, the trigger would be $("#hiddenButton").trigger("mousedown"), as opposed to click.
I will test myself in a few with widget-form and tell you my results.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 12:05 PM
You get this to work dpalmer?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2018 03:34 PM
I got this to work. add that to your onClick function
$timeout(function(){
angular.element('[ng-click*="buttonClicked"]').triggerHandler('click');
}, 300);