How to display pop-up messages in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 09:47 PM
hello.
I would like to display a pop-up message when the mouse cursor is placed on a widget such as an icon link in the service portal.Is this possible?
If possible, please tell me how.
Regards,
Ro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 01:41 AM
Hello,
Change 'About us' to reflect title and 'Hooray!' with the message you want to show on hover.
In HTML field :
<li><a href="" data-toggle="tooltip" title="Hooray!"><i class=" icon-pencil icon-2x"></i>About Us</a></li>
In client controller:
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 08:56 PM
hello.
Do you write to the target widget's HTML and the client controller?
Regards,
Ro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 01:51 AM
Hi,
You can use below code for this requirement
// HTML template
<button ng-mouseover="c.onAlert()" class="btn btn-default">
Alert
</button>
// Client script
function(spModal) {
var c = this;
c.onAlert = function () {
spModal.alert('How do you feel today?').then(function (answer) {
c.simple = answer;
});
}
}
Please Make it helpful/correct if this helps you.
Thanks,
Akshay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 08:54 PM - edited 12-01-2022 09:05 PM
hello.
I'm currently using ServiceNow's default icon link, how do I write the above HTML template into the HTML for that?
Also, how do you set the client script table and type?
Regards,
Ro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 02:08 AM
@Ro5 You can use spModal.open() function to show popup.
You will get the sample code in the documentation.
Link to documentation: https://developer.servicenow.com/print_page.do?release=quebec&category=null&identifier=SPModal-API&m...
Mark as correct answer if this solves your issue
ServiceNow Community Rising Star, Class of 2023