1

I read a lot of toast in lightning but in standalone app it's not working. In this guide https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_one.htm

...} else {
    //your toast implementation for a standalone app here
...}

But I never see real working implementation of custom toast.

  • What the documentation says is, the toast works in a lightning component when used in lightning UI or Salesforce1 app. Some scenario like for instance when a component to classic UI via lightning out with Visualforce, the toast notification simply doesn't work. In that case you should have your own notification method like using a apex:pagemessage's or any other way. That being said: what is your main question? – Raul Nov 3 '17 at 10:09
  • My question what right aproach I shouid used for creating own toast. – Taras Oleksiuk Nov 3 '17 at 10:16
  • Its new component or apex:pagemessage or something else, if new component I should insert it into v.body? – Taras Oleksiuk Nov 3 '17 at 10:23
  • Its primarily opinion based on how to display a notification. Probably toast doesn't work on classic UI, would be good to use page message. Writing another component to mimic toast for that scenario would be a lot of work and easiest is with page message. – Raul Nov 3 '17 at 10:28
  • You should check this answer we are using it and it works perfect in our lightning components. – Basti Nov 3 '17 at 10:32
0

To implementation of custom toast in places where it doesn't work you have to use javascript setTimeout with the combination of div and some CSS.

  • 2
    maybe some concrete solution? – Taras Oleksiuk Nov 3 '17 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.