function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jonathan Wolff 7Jonathan Wolff 7 

Render Attributes in User Details component

Hello, I have a component that displays the details of the account owner user :
User-added image
In the user page I have two custom fields " Urlaub" and Vertreter.

When Urlaub is checked I want the Details of the Vertreter to be displayed on the right of the component
User-added image
The problem I have is that the right side does not render right and I do not get the details of the right side.
Could you tell me how to fix it?

My Component Code:
 
<aura:component controller="VisitenkarteRecordDetails" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <aura:attribute name="OwnerUser" type="user" default="{'sobjectType' : 'User'}" />   
    <aura:attribute name="ids" type="id" default="{!v.recordId}" />
    
    <div class="c-container" style=" border-radius: 4px;  background-color: #FFFFFF; ">
        <lightning:layout >            
            <lightning:layoutItem padding="around-small">
                <div class="header-column">
                    <img src="{!v.OwnerUser.SmallPhotoUrl}" class="img_size" variant="circle" height="180px;"  />
                </div>
            </lightning:layoutItem>            
            <lightning:layoutItem padding="around-small">                
                <br></br>                
                <div class="header-column" width="100%">
                    <div style="font-size: 15px;"><b>{!v.OwnerUser.Name}</b></div>
                    <div style="font-size: 10px;">Team {!v.OwnerUser.Team_2020__c}</div>
                    <div>
                        <a href="{!'tel:' + v.OwnerUser.MobilePhone}"><lightning:icon iconName="action:call" size="xx-small" alternativeText="Telefon" title="Telefon" /></a>&nbsp;
                        <a href="{!'mailto:' + v.OwnerUser.Email}"><lightning:icon iconName="action:email" size="xx-small" alternativeText="E-Mail" title="E-Mail" /></a>&nbsp;
                        <a href="{!v.OwnerUser.Link_BookingTime__c}" target="_blank"><lightning:icon iconName="action:new_event" size="xx-small" alternativeText="BookingTime" title="BookingTime" /></a> 
                    </div>
                    
                </div>
            </lightning:layoutItem>
            <lightning:layoutItem padding="around-small">                
                <br></br>                
                <div class="header-column" width="100%" rendered="{v.OwnerUser.Urlaub__c == 'true'}">
                    <div style="font-size: 15px;"><b>{!v.OwnerUser.Vertreter__c.Name}</b></div>
                    <div style="font-size: 10px;">Team {!v.OwnerUser.Team_2020__c}</div>
                    <div>
                        <a href="{!'tel:' + v.OwnerUser.Vertreter__c.MobilePhone}"><lightning:icon iconName="action:call" size="xx-small" alternativeText="Telefon" title="Telefon"   /></a>&nbsp;
                        <a href="{!'mailto:' + v.OwnerUser.Vertretung__c.Email}"><lightning:icon iconName="action:email" size="xx-small" alternativeText="E-Mail" title="E-Mail" /></a>&nbsp;
                        <a href="{!v.OwnerUser.Vertreter__c.Link_BookingTime__c}" target="_blank"><lightning:icon iconName="action:new_event" size="xx-small" alternativeText="BookingTime" title="BookingTime" /></a> 
                    </div>
                    
                </div>
            </lightning:layoutItem>
             
        </lightning:layout>        
    </div>    
</aura:component>
 
({     
    doInit : function(component, event, helper) {       
        var AccountIDS=component.get("v.ids");             
        console.log('account ids'+ AccountIDS);              
        var action = component.get("c.fetchUserDetail");         
        action.setParams({                   
            "Accountids" : AccountIDS });        
        action.setCallback(this, function(response) {            
            var state = response.getState();            
            if (state === "SUCCESS") {               
                var res = response.getReturnValue();                
                component.set('v.OwnerUser', res);             
            }                                 
        });               
        $A.enqueueAction(action);      
    }, 
})

 
PriyaPriya (Salesforce Developers) 

Hey Jonathan, 

If the requirement is to enable the field based on checkbox selection then kindly refer this document :- 

https://developer.salesforce.com/forums/?id=9062I000000IFI9QAO

Regards,

Priya Ranjan