Change timeout for spUtil.addErrorMessage on Portal

David Morden
Mega Expert

I have a client that would prefer to have a disclaimer on their community page, but they want it as a "splash" message like an error message.   However, they want to extend the timeout on it so that it lasts for 10 seconds.   I have tried several iterations of different options with no luck.   Here is my base code to play with, and as always, any help is GREATLY appreciated.

HTML Template

<sp-widget widget="c.cri_community_disclaimer"></sp-widget>

Client Script

function($scope, spUtil){

      var c = this;

      $scope.m = $scope.data.msgs;

      spUtil.addErrorMessage($scope.m.disclaimerMsg);

}

Server Script

(function() {

  var m = data.msgs = {};

      m.disclaimerMsg = gs.getMessage("This is the content of the message");

})();

1 ACCEPTED SOLUTION

Here it is. I actually looked a bit more and it could be even simpler. This is the widget you can place where you want.



This code will show the "div" and it's content for 5000 milliseconds..



This is all you need for that. But I guess you probably wanna style it some more



find_real_file.png


View solution in original post

7 REPLIES 7

Sure, I'll see if I can throw up an example.


Here it is. I actually looked a bit more and it could be even simpler. This is the widget you can place where you want.



This code will show the "div" and it's content for 5000 milliseconds..



This is all you need for that. But I guess you probably wanna style it some more



find_real_file.png


That makes a ton more sense than where my head went with it (my blinders are still too thick from designing).



Thanks for your help!