You need to sign in to do that
Don't have an account?
leoSFDC 13
I am getting above error in Aura Components Specialist step 5,I am not able to find why the chanllege is not completed ,Below is line of code, Please help ... Thanks in advance
boattile.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="boat" type="Boat__c"></aura:attribute>
<aura:attribute name='selected' type='Boolean' default='false'/>
<aura:registerEvent name ="boatSelect" type="c:BoatSelect"></aura:registerEvent>
<lightning:button class="{!v.selected ? 'tile selected' : 'tile'}" onclick ="{!c.onBoatClick}">
<div style="{!'background:' + v.boat.backgroundColor + ' url(' + v.boat.Picture__c +') no-repeat;'}" class="innertile">
<div class="lower-third">
<h1 class="slds-truncate">{!v.boat.Name}</h1>
</div>
</div>
</lightning:button>
</aura:component>
boattileController.cmp
({
onBoatClick : function(component, event, helper) {
var boatSelect = component.getEvent("boatSelect");
var boatId = component.get("v.boat").Id;
boatSelect.setParams({"boatId":boatId});
boatSelect.fire();
}
})
BoatSearchResult.Cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" controller="BoatSearchResults" access="global" >
<aura:attribute name="boats" type="Boat__c[]"></aura:attribute>
<aura:attribute name="boatTypeId" type="string"></aura:attribute>
<aura:handler name="boatSelect" event="c.BoatSelect" action="{!c.onBoatSelect}"></aura:handler>
<aura:handler name="init" value="{!this}" action="{!c.getDataBoats}"></aura:handler>
<aura:attribute name="selectedBoatId" type="string"></aura:attribute>
<aura:method name="search" access="global" action="{!c.doSearch}" >
<aura:attribute name="boatTypeId1" type="String"/>
</aura:method>
<lightning:layout multipleRows="true">
<aura:if isTrue="{!v.boats}">
<aura:iteration items="{!v.boats}" var="boat">
<lightning:layoutItem size="4">
<c:BoatTile boat="{!boat}" selected="{!boat.Id == v.selectedBoatId ? true : false}"/>
</lightning:layoutItem>
</aura:iteration>
BoatSearchResultController
({
getDataBoats : function(component, event, helper) {
var boatTypeId = component.get("v.boatTypeId");
console.log('boatTypeId>>>'+boatTypeId);
helper.onSearch (component);
},
doSearch : function(component, event, helper) {
var params = event.getParam('arguments');
console.log('params>>>'+params.boatTypeId1);
component.set('v.boatTypeId',params.boatTypeId1);
helper.onSearch(component);
},
onBoatSelect : function(component, event, helper) {
var boatId = event.getParam("boatId");
component.set("v.selectedBoatId",boatId);
console.log('helloji2>>');
}
})
Aura Components Specialist
I am getting above error in Aura Components Specialist step 5,I am not able to find why the chanllege is not completed ,Below is line of code, Please help ... Thanks in advance
boattile.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="boat" type="Boat__c"></aura:attribute>
<aura:attribute name='selected' type='Boolean' default='false'/>
<aura:registerEvent name ="boatSelect" type="c:BoatSelect"></aura:registerEvent>
<lightning:button class="{!v.selected ? 'tile selected' : 'tile'}" onclick ="{!c.onBoatClick}">
<div style="{!'background:' + v.boat.backgroundColor + ' url(' + v.boat.Picture__c +') no-repeat;'}" class="innertile">
<div class="lower-third">
<h1 class="slds-truncate">{!v.boat.Name}</h1>
</div>
</div>
</lightning:button>
</aura:component>
boattileController.cmp
({
onBoatClick : function(component, event, helper) {
var boatSelect = component.getEvent("boatSelect");
var boatId = component.get("v.boat").Id;
boatSelect.setParams({"boatId":boatId});
boatSelect.fire();
}
})
BoatSearchResult.Cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" controller="BoatSearchResults" access="global" >
<aura:attribute name="boats" type="Boat__c[]"></aura:attribute>
<aura:attribute name="boatTypeId" type="string"></aura:attribute>
<aura:handler name="boatSelect" event="c.BoatSelect" action="{!c.onBoatSelect}"></aura:handler>
<aura:handler name="init" value="{!this}" action="{!c.getDataBoats}"></aura:handler>
<aura:attribute name="selectedBoatId" type="string"></aura:attribute>
<aura:method name="search" access="global" action="{!c.doSearch}" >
<aura:attribute name="boatTypeId1" type="String"/>
</aura:method>
<lightning:layout multipleRows="true">
<aura:if isTrue="{!v.boats}">
<aura:iteration items="{!v.boats}" var="boat">
<lightning:layoutItem size="4">
<c:BoatTile boat="{!boat}" selected="{!boat.Id == v.selectedBoatId ? true : false}"/>
</lightning:layoutItem>
</aura:iteration>
BoatSearchResultController
({
getDataBoats : function(component, event, helper) {
var boatTypeId = component.get("v.boatTypeId");
console.log('boatTypeId>>>'+boatTypeId);
helper.onSearch (component);
},
doSearch : function(component, event, helper) {
var params = event.getParam('arguments');
console.log('params>>>'+params.boatTypeId1);
component.set('v.boatTypeId',params.boatTypeId1);
helper.onSearch(component);
},
onBoatSelect : function(component, event, helper) {
var boatId = event.getParam("boatId");
component.set("v.selectedBoatId",boatId);
console.log('helloji2>>');
}
})