You need to sign in to do that
Don't have an account?
sri vinod korlakunta 15
Lightning Component Framework Specialist Step 3
Challenge Not yet complete... here's what's wrong:
The BoatSearchResults JavaScript controller doesn't call the correct method. The controller must call helper.onSearch(), passing the component.
Anyone Completed this step Please help me with the Answer.
The BoatSearchResults JavaScript controller doesn't call the correct method. The controller must call helper.onSearch(), passing the component.
Anyone Completed this step Please help me with the Answer.
({
doSearch : function(component, event, helper) {
component.get("v.boatTypeId");
helper.onSearch(component, event, helper);
},
})
Here is the helper class : BoatSearchResultsHelper.js
({
onSearch : function(component, event, helper) {
var boatTypId = component.get("v.boatTypeId");
console.log("boatTypId--> " + boatTypId);
// create an action
var action = component.get("c.getBoats");
action.setParams({boatTypeId:boatTypId});
action.setCallback(this, function(response) {
var state = response.getState();
if(state == "SUCCESS") {
console.log("response.getReturnValue() " + response.getReturnValue());
component.set("v.boats", response.getReturnValue());
} else {
console.log("Failed with state: " + state);
}
});
// Send action off to be executed
$A.enqueueAction(action);
}
})
This should work.