You need to sign in to do that
Don't have an account?

ightning Component Framework Specialist SuperBadge Issue at Step 3.
<aura:component controller="BoatSearchResults"> <aura:handler name="init" action="{!c.doSearch}" value="{!this}"/> <aura:attribute name="boats" type="Boat__c[]" /> <lightning:layout horizontalAlign="center" verticalAlign="center"> <lightning:layoutItem flexibility="grow" class="slds-m-right_small" > <aura:iteration items="{!v.boats}" var="boatVar"> <c:BoatTile boat="{!boatVar}"/> </aura:iteration> <aura:renderIf isTrue="{!v.boats.length==1}"> <div style="margin-left: 50%;"> <ui:outputText value="No boats found" /> </div> </aura:renderIf> </lightning:layoutItem> </lightning:layout> </aura:component>
({ onSearch : function(component, event, helper) { console.log('In Helper'); var action=component.get('c.getBoats'); action.setParam({"boatTypeId":''}); action.setCallback(this,function(response) { if(response.getState() === 'SUCCESS') { var boatslist = response.getReturnValue(); component.set("v.boats",boatslist); } }); $A.enqueueAction(action); } })
({ doSearch: function(component, event, helper) { helper.onSearch(cmp); } })
public with sharing class BoatSearchResults { @Auraenabled public static List<Boat__c> getBoats(String boatTypeId) { if(boatTypeId != '') { return ([Select Id,Name, BoatType__c , Contact__r.Name , Description__c,Geolocation__c,Length__c,Price__c,Year_Built__c from Boat__c Where Id = :boatTypeId]); } else { return ([SELECT Id, BoatType__c, picture__c, name,contact__r.Name from Boat__c]); } } }
Sorry for this issue you are facing.
I would suggest you do a few modifications to your code.
BoatSearchResultsController.js BoatSearchResultsHelper.js Hope this helps.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
All Answers
Sorry for this issue you are facing.
I would suggest you do a few modifications to your code.
BoatSearchResultsController.js BoatSearchResultsHelper.js Hope this helps.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
https://salesforceallinone.blogspot.com/2018/03/lightning-component-framework_87.html