[Help] Modal Buttons & Forms

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2018 07:08 AM
Hello,
I'm looking to create a modal button in the service portal which displays my password reset form.
Anyway to achieve this?
I've seen some similar posts and it doesn't seem to help me.
To start with, I've used "Serviveportal.io" code to display the modal, but I haven't had any luck with trying to display the password reset form.
Any help is appreciated.
Thanks,
Jordan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2018 08:47 PM
Build your button in the Body HTML Template:
<button class="btn btn-primary" ng-click="c.openModal()">Click me</button>
In the Client Controller, add the spModal parameter to your function declaration. Something like this:
function ($scope, spUtil, snRecordWatcher, spModal) {
Finally, add your modal code in the Client Controller:
c.openModal = function(){
spModal.open({
widget: "d4e159841302fa00ba1530128144b092", //The sys_id of the widget you'd like to call
size: "lg",
buttons: [{label:'✘ ${Close}', cancel: true}],
widgetInput: {sys_id: "cd6c58d013362200ba1530128144b042"} //the sys_id of your cat item. I believe the name may work here as well, but I've never tried it
});
},
Additional options for the .open function (size, buttons, etc.) can be found here
Hope this helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 02:41 AM
Hi Matthew,
Thanks for the reply, I have a quick question.
How do I get the sys_id of widgets on the portal?
Thanks,
Jordan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 03:58 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 04:01 AM
Widget Code:
HTML:
<div>
<button class="btn btn-primary" ng-click="c.openModal()">${Open Modal}</button>
</div>
Client Script:
function($uibModal, spUtil, spModal, $scope) {
var c = this;
c.openModal = function() {
spModal.open({
widget: "752893094f45978021a168d18110c713", //add widget sys_id
size: "lg",
buttons: [{label: '✘ ${Close}', cancel: true}],
widgetInput: {sys_id: "752893094f45978021a168d18110c713"} // add cata item sys_id
});
}
}