2

I found lightning:messages in trailhead and want to use it in my component, but I couldn't find it in Lightning Component Library.

How can I know its description?

This is my sample.

 <lightning:messages aura:id="myMessage"/>
buttonClick:function(component,event,helper){ 
let err = {
            "errors": "ERROR!"
           };
            component.find('myMessage').setError(err['errors']);
}

I wish I could set some other option.

Added image of what I need, it's a Attribute of lightning:input.

If lightning:messages have options like this, I want to know them.

enter image description here

4
  • do you want to change the error that is being displayed by default?
    – User6670
    Jan 31, 2020 at 8:30
  • i want to display the error looks like that displayed by default in my component. Moreover, it is better that i can use some option which like set button to close the error.
    – Hayato
    Jan 31, 2020 at 9:03
  • so you just need a button to hide error?
    – User6670
    Jan 31, 2020 at 9:27
  • At minimum, yes.I know that i can hide error by set null. i want to know that 'what is available by default option of this tag?'.
    – Hayato
    Jan 31, 2020 at 9:41

2 Answers 2

-1

Hi it was in developer preview mode details can be found https://developer.salesforce.com/blogs/2019/10/lightning-message-service-developer-preview.html It may not available in component liberary.

1
  • I found <lightning:messages> in trailhead about Lightning Data Service, when released in Winter '18, but Lightning Message Service released in Winter '20. It seems strange.
    – Hayato
    Jan 31, 2020 at 2:39
-1

Lightning Message Service which can be used to exchange data between Visualforce, Aura Component and Lightning Web Components. Unlike previous process, we don’t need to import any external library like pub or sub.

Please refer this LINK. There is detailed description & code here.

Hope your problem is solved.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .