• SF_32
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 1
    Replies
Hi Everyone,
I want to upload upload multiple files by chunking and converting to base 64 in LWC.
I tried looping them by helper function but no luck.
handleUpload(){
        if(this.selectedFilesToUpload.length > 0) {
            this.showSpinner = true;
            
            this.file = this.selectedFilesToUpload[0];
            this.fileReaderObj = new FileReader();

            this.fileReaderObj.onloadend = (() => {
                let fileContents = this.fileReaderObj.result;
                fileContents = fileContents.substr(fileContents.indexOf(',')+1)
                let sliceSize = 1024;           
                let byteCharacters = atob(fileContents);
                let bytesLength = byteCharacters.length;
                let slicesCount = Math.ceil(bytesLength / sliceSize);                
                let byteArrays = new Array(slicesCount);
                for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
                    let begin = sliceIndex * sliceSize;
                    let end = Math.min(begin + sliceSize, bytesLength);                    
                    let bytes = new Array(end - begin);
                    for (let offset = begin, i = 0 ; offset < end; ++i, ++offset) {
                        bytes[i] = byteCharacters[offset].charCodeAt(0);                        
                    }
                    byteArrays[sliceIndex] = new Uint8Array(bytes);                    
                }
 
                this.myFile =  new File(byteArrays, this.fileName, { type: this.fileType });

                let reader = new FileReader();
                reader.onloadend = (() => {
                    let base64data = reader.result;
                    this.base64FileData = base64data.substr(base64data.indexOf(',')+1); 
                    this.fileUpload();
                });
                reader.readAsDataURL(this.myFile);                                 
            });
            this.fileReaderObj.readAsDataURL(this.file);            
        }
        else {
            this.fileName = 'Upload any file';
        }
    }

 
  • May 17, 2020
  • Like
  • 0

  We have registered a namespace in our Partner Developer Edition Org.
We want to reuse the namespace in a dev hub org by linking it 
We could successfully link the namespace but unable spinoff a scratch org to reuse the namespace.  
  • April 16, 2020
  • Like
  • 0

  Hi everyone,
 I have installed a managed package in our org which already has a managed package previously.
There is a feature where both the applications are using the same standard object "Order".
I am facing an issue when I submit an order from my application it has a mandatory custome field showing from another managed package.
I know I can remove it from page-layout but is there any correct explanation for this.
Any help would be appreciated.
  • April 07, 2020
  • Like
  • 0
I am trying to make the slideshow of images in the lightning component using simple HTML and Javascript but there is an error showing up cannot read property 'style' of undefined. Any help would be appreciated. Here I am loading the images from the parent component.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" controller="images_controller">
     <aura:handler name="init" value="{!this}" action="{! c.doInit }"/>
    <aura:attribute name="selectdImage" type="String" />
    <aura:attribute name="value" type="String" />
   <div class="slideshow-container">
 <div class="slideshow-container slds-scrollable_x">
            <aura:iteration items="{!v.value}" var="row">
     <div class="images" id="msg" style="display: none">
         <img src="{!row.imageURL}" style="width:100%">
         </img>
                </div>
        </aura:iteration>
          </div>
       </div>
</aura:component>
 
({
  doInit: function(component, event, helper) {
    var slideIndex = 0;
    var slides;
    var i;
      var s;
      var p;

    console.log("welcome");
    slides = document.querySelectorAll('.images');
 	    if (slides !== undefined) {
        var displayNone = component.get('c.applyCSSNone');
      for (i = 0; i < slides.length; i++) {
          
        slides[i].displayNone ;
      }

      slideIndex++;
      console.log("entered hereee" + slides);
      if (slideIndex > slides.length) {
        slideIndex = 1;
      }
        var displayBlck = component.get('c.applyCSSBlock');
     slides[slideIndex - 1].displayBlck ;
     setTimeout(doInit, 2000);
    }
  },
    applyCSSNone: function(component, event) {
      var c = component.find("carousel");
      $A.util.addClass(c, 'mySlides');
   },
   applyCSSBlock: function(component, event) {
      var d = component.find("carousel");
      $A.util.addClass(d, 'myImages');
   }
});
 
.THIS .mySlides {
    display:none;
}
.THIS .myImages {
    display:block;
}

 
  • November 12, 2019
  • Like
  • 0
Hi All,
I am facing some issues with a lightning carousel that I am building in lwc like it is showing only 5 to 6 images inside the carousel and remaining are not showing up. If there is any limitation for the number of images could you please suggest the best approach to build a carousel for 1000's of images inside the carousel.
Here I am loading the images from the parent component.
<template>
   
              <div class="slds-m-around_medium">
                    
                                        
                        <div class="container">                    
                                    
                   <lightning-carousel> 
                                                                           
                      <template for:each={value}  for:item="rows">
                                 
                         
                              <lightning-carousel-image  width="100%" height="50%"  key={imageURL} src = {rows.imageURL}
                              header={rows.imageName}
                              description={rows.imageDescription}>
                             </lightning-carousel-image>
                             
                        
                           
                       </template>
                     
                    </lightning-carousel>
                </div>
               </div>
        <!--   </lightning-card> -->
</template>
 
import { LightningElement, api } from "lwc";

export default class fcxmCarousel extends LightningElement {
  @api selectdImage;
  @api value;
}

 
  • October 31, 2019
  • Like
  • 0

  We have registered a namespace in our Partner Developer Edition Org.
We want to reuse the namespace in a dev hub org by linking it 
We could successfully link the namespace but unable spinoff a scratch org to reuse the namespace.  
  • April 16, 2020
  • Like
  • 0