spModal WidgetInput not working?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2016 03:42 PM
Hi Everyone,
Quick question. I'm working on a set of Service Portal widgets. And I want to open a widget within a modal as popup.
function(spModal) {
/* widget controller */
var c = this;
c.onAction = function(title, action) {
// ask the user for a string
// note embedded html in message
spModal.open({
title: title,
widget: 'drdc-action-modal',
widgetInput: {
action: action,
environment: 'asdfasdfsafd'
}
}).then(function(){
console.log('widget dismissed');
})
}
}
So this is the quick and dirty code. Copied from the github help pages.
The popup/modal opens just fine however the options are not passed through to widget. If i dump the complete options it just outputs:
{"sp_widget_dv":"","sp_column_dv":"","active":false,"sys_tags":"","order":-1}
Do you guys no what i'm doing wrong?
Thnx in advance!
Maybe there is some other feature not using spModal?
Kind regards,
Luc
- 4,687 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2018 01:16 AM
Just Checking, did you find a solution to this?
Thanks,
Mandar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2018 11:07 AM
Could you please let me know how to use widgetInput attributes in the widget client or server side which is calling the model itself .
widgetInput: {
action: action,
environment: 'asdfasdfsafd'
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2018 06:40 AM
For me, I can never get the ".then()" to ever trigger.
}).then(function(){
console.info('widget dismissed');
})
Nothing ever gets logged to the console.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2018 05:37 AM
Hi there,
I'm answering this thread because I found it on ... my default search engine while trying to understand why I couldn't see my widget server code logs when my widget was opened with spModal.
The documentation for spModal is correct, you get the "widgetInput" object as "input" in your server script.
What puzzled me for nearly an hour was that I couldn't see the output of $sp.log in my browser console in this case, making me think that my server script was not running. I hope it will help someone in the same situation.
/Sylvain