• Mohammed Sheriff 1
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
Hi All, I am facing an issue with sites guest users unable to download attachments from salesforce
Here is the snippet  of the code component

<aura:component controller="Images_Callout" implements="force:appHostable,flexipage:availableForAllPageTypes access="global" >
  
    <aura:attribute name="img" type="Map"/>
    <aura:attribute name="response" type="Map"/>
    <aura:attribute name="aspectRatio" type="string" default="Square" />
    <aura:attribute name="properties" type="List"/>
    <aura:attribute name="value" type="List"/>
   <aura:attribute name="container" type="List"/>
   <aura:attribute name="PageSize" type="Integer" default="10"/>
   <aura:attribute name="currentPageNumber" type="Integer" default="1"/>
   <aura:attribute name="totalPages" type="Integer" default="0"/> 
   <aura:attribute name="pageList" type="List"/>       
  <aura:attribute type="String" name="base" default ="https://pixabay.com/images/"/>
   <aura:attribute name="imageId" type="String"/>
     <!--Header part-->
        <div class="slds-page-header" role="banner">
            <div>
                <p class="slds-page-header__title slds-truncate" title="Image Selection">Images</p>
            </div>
        </div>
        <!--Header part close-->
      
   <aura:iteration items="{!v.img}" var="item"  start="0">
        <aura:if isTrue="{!item.ImageId!=null}">
        <aura:iteration items="{!v.item}" var="mapValue">
            <aura:if isTrue="{!mapValue.aspectRatio == v.aspectRatio}">
            <div class ="gallery" onclick="{!c.onClick}" title="{!item.ImageId}" >
             <img src= "{!v.base + mapValue.imageFile}"  style="width:200px;"/>
            </div>
            </aura:if>
       </aura:iteration>
     <div class="Container">
         <lightning:button variant="brand" label="SingleProperty" onclick="{!c.onClick2}" /> 
           <lightning:button variant="brand" label="Multiproperty" onclick="{!c.onClick2}" /> 
           <lightning:button variant="brand" label="Branded Property" onclick="{!c.onClick2}" /> 
         <lightning:button variant="neutral" label="Close" onclick="{!c.closeMe}"/>
    </div>
 
</aura:component>

Client controller

({
    getResponse: function(component, event) {
        // create a server side action.       
        var action = component.get("c.getResponseContent");
        // set the url parameter for getResponseContents method (to use as endPoint)
        action.setStorable(); 
        action.setParams({"payload":'{ "types": ["PPT_IMAGE"]}',
            "url": 'https://pixabay.com/api/?key=13561952-c6ff1da5b37420c109968e25c'});
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (component.isValid() && state === "SUCCESS") {
              
                // set the response(return Map<String,object>) to response attribute.      
                component.set("v.response", response.getReturnValue());
                var getContents = component.get("v.response");
                component.set("v.img", getContents.content);
           }                
        });            
                
    
    }
});

sample of the  json reponse

{
    "total": 1,
    "numRecords": 1,
    "maxRecords": 1,
    "content": [{
            "ImageId": "1430a3eb",
            "type": "PPT_IMAGE",
            "taxonomies": ["/Pty Codes/S/BGVCX"],
            "images": [{

                    "imageFile": "/photo/2013/10/15/09/12/Roseflower-19589_150.jpg",
                    "aspectRatio": "2x1"
                    
                }, {
                    "imageFile": "/photo/2015/11/15/09/12/Roseflower-19589_151.jpg",
                    "aspectRatio": "3x1"
                
                }, {
                    "imageFile": "/photo/2013/10/15/09/12/Roseflower-19589_152.jpg",
                    "aspectRatio": "3x2"
                    
                }, {
                    
                    "imageFile": "/photo/2013/10/15/09/12/Roseflower-19589_153.jpg",
                    "aspectRatio": "2x2"
                    
                    }] 
                
            }]
}

There are tons of images in the json response  and they are not store locally. I will like to show all images using pagination, so the viewer can view all available images. Can you please help? Thanks in advance, Mohamed

 
How can I pass data from one lightning component and to another lightning component. Please help ?

Thanks in advance
 
<aura:iteration items="{!v.img.content}" var="item" >
        <aura:if isTrue="{!item.guid!=null}">
       
        <aura:iteration items="{!item.images}" var="mapValue">
            <div class ="gallery">
                
             <img src= "{!v.base + mapValue.imageFile}" style="width:200px;height:200px;"/>
             <div class="desc">
             
            <ui:inputCheckbox aura:id="checkbox" name="Select" value ="{!mapValue.aspectRatio}" change="{!c.onCheck}"/>
            
      </div></div>
       </aura:iteration>
        </aura:if>
    </aura:iteration>
({
onCheck: function(cmp, evt) {
    var checkCmp = cmp.find("checkbox");
 alert(checkCmp.get("v.value"));      
        
 }
})
I am having issue with getting the value of the selected checkbox  and disabling the other checkboxes ,can someone please help me?
Thanks in advances.
Hi All, I am facing an issue with sites guest users unable to download attachments from salesforce