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

JC S_
Mega Guru

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?

find_real_file.png

7 REPLIES 7

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.

You get this to work dpalmer?

I got this to work. add that to your onClick function

$timeout(function(){
							 angular.element('[ng-click*="buttonClicked"]').triggerHandler('click');
							 }, 300);