Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ({
- buttonClicked : function(component, event, helper) {
- alert("Button Clicked");
- },
- /**
- Method: displayAttachments
- Return Value: null
- Description: Launched when attachment list is changed.
- Updates or creates new Attachement DOM elements on the component
- */
- displayAttachments : function(component, event, helper){
- console.log("==>caseFeedPublisher Method:displayAttachments");
- var inputFileControl = component.find("attachFile").getElement();
- var inputFileList = inputFileControl.files;
- var inputFileLength = inputFileList.length;
- console.log("No of attachments:"+inputFileLength);
- for(var i=0; i<inputFileLength;i++){
- console.log("=============>File Number: "+i);
- console.log("File Name: "+inputFileList[i].name);
- console.log("File Type: "+inputFileList[i].type);
- console.log("File Size: "+inputFileList[i].size+" bytes");
- $A.createComponent(
- "c.caseFeedCommentAttachment",
- {
- "filename": inputFileList[i].name,
- },
- function(newComponent){
- if(component.isValid()){
- var showAttach = component.get("v.attachments");
- console.log("showAttach size: "+showAttach.length);
- showAttach.push(newComponent);
- console.log("showAttach size: "+showAttach.length);
- component.set("v.attachments",showAttach);
- }
- }
- );
- }
- },
- handleRemoveAttachment : function(component, event, helper){
- console.log("In case Feed Publisher: Event Handled");
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement