You need to sign in to do that
Don't have an account?
Manish Anand 22
lightning component framework SuperBadge challenge 3
Hi,
I passed this challenge. However, when I load the it, (through lightning page or an app) it gives an error- Action failed: c:BoatSearchResults$controller$doSearch [component is not defined]
In the code as well, there seems to be no reason to get this error. Below is my code.
Any hints, why it wouldn't load the app?
Thanks,
Manish
I passed this challenge. However, when I load the it, (through lightning page or an app) it gives an error- Action failed: c:BoatSearchResults$controller$doSearch [component is not defined]
In the code as well, there seems to be no reason to get this error. Below is my code.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" controller="BoatSearchResults"> <aura:handler name="init" value="{!this}" action="{!c.doSearch}" /> <aura:attribute name="boats" type="Boat__c[]" /> <lightning:layout multipleRows="true" horizontalAlign="center"> <aura:iteration items="{!v.boats}" var="boatVar"> <lightning:layoutItem flexibility="grow" class="slds-m-right_small" > <c:BoatTile boat="{!boatVar}"/> </lightning:layoutItem> </aura:iteration> <aura:if isTrue="{!lessthan(v.boats.length,1)}"> <lightning:layoutItem class="slds-align_absolute-center" flexibility="auto" padding="around-small"> <ui:outputText value="No boats found" /> </lightning:layoutItem> </aura:if> </lightning:layout> </aura:component>
({ doSearch: function(component, event, helper) { console.log('In do Search'); helper.onSearch(component,event,helper); } });
({ onSearch : function(Component, event, helper) { console.log('In Helper'); var action=component.get('c.getBoats'); action.setCallback(this,function(response) { if(response.getState === 'SUCCESS') { var boatslist = response.getReturnValue(); component.set("v.boats",boatslist); } }); $A.enqueueAction(action); } })Below is the screenshot of the error message:
Any hints, why it wouldn't load the app?
Thanks,
Manish
Thanks,
Challenge Not yet complete... here's what's wrong:
The getBoats() method isn't working properly. Define getBoats() In the BoatSearchResults Apex controller to accept an optional boatTypeId and return all boats if no boatTypeId is passed, and a filtered list of boats if a boatTypeId is passed.
Close errors : Can someone help me out !