Last active
August 29, 2015 14:24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:attribute name="messages" type="Aura.Component[]" access="GLOBAL"/> | |
<div aura:id="messages"> | |
{!v.messages} | |
</div> | |
//Script for Error handling | |
else if (state === "ERROR") { | |
var errors = response.getError(); | |
if (errors) { | |
if (errors[0] && errors[0].pageErrors) { | |
console.log(errors[0].pageErrors); | |
$A.createComponents([ | |
["ui:message",{ | |
"title" : "Deletion Failed:", | |
"severity" : "error", | |
}], | |
["ui:outputText",{ | |
"value" : errors[0].pageErrors[0].message | |
}] | |
], | |
function(components) { | |
var message = components[0]; | |
var outputText = components[1]; | |
// set the body of the ui:message to be the ui:outputText | |
message.set("v.body", outputText); component.set("v.messages", message); setTimeout(function() { | |
$A.run(function() { component.set("v.messages", []); | |
}); | |
}, 10000) | |
} ) | |
} | |
} else { | |
$A.error("Unknown error"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment