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

Lightning Component Framework Specialist SuperBadge - Issue with Step 6.
I am getting below error

but my application has

May I know why am not able to pass this challenge ?
but my application has
May I know why am not able to pass this challenge ?
Please try as above
All Answers
Please try as above
Especially when they disallow obvious and clean code in favour of the non-obvious and cockamamie.
The data of type Boat__c comes in from the SelectedBoat.evt under the parameter name boat. Note: these are only a few fields that came in with the SOQL search, not the full set of fields that force:recordData should provide. BoatDetails.cmp receives the event and handles it with onBoatSelected... BoatDetailsController.js has the onBoatSelected function, which pulls the boat param from the event (in Boat__c format). That boat param isn't all of the record fields we need -- we really are only supposed to need the Id, to feed to Lightning Data Service (LDS). So I don't set v.boat to boat here (commented out below. It doesn't work if it's uncommented, either.) I just set v.id by pulling the Id field from boat. You'll see my console.log line where I've confirmed that this works: boat data received, and the id attribute on BoatDetails.cmp is successfully set. At this point, when I run it, selecting a boat successfully sets the id attribute, but the LDS isn't accessing that and loading the boat fields. The boat attribute on the component remains undefined. So, I added this line to the onBoatSelected function, to force a reload: Now, boat appears to be getting a value because my conditional markup is rendering BoatDetails.cmp in the browser. However, I'm getting an empty record, as LDS seems to be wiping out any boat data I had put in, and more importantly, isn't accessing the data for the boat designated by v.id.
Here's the force:recordData markup, along with the aura:attribute declarations.
What am I screwing up? :)
I've been over all the docs for Lightning Data Service, as well as the Trailhead modules on it, and I can't find any reference to forcing the LDS to load a specific record. All the examples I see are where they're using the recordId implicit in the page, using force:hasRecordId. But in this case, we want to feed it the boat id that we extracted from the BoatSelected.evt, which I've inserted into v.id.
I included a reload line in my onBoatSelectedHandler: But that doesn't seem to work, and it's not what the validation is checking for.
So how do you force LDS to reload a record? (Or load it in the first place!)
@Pat_McClellan : I was struck at same place as you. Gone through most of documentation available, but could not find any pointers to forcing the LDS to load a specific record. I even tried the below approcah of setting recordId of force:recordData but could not get the boat details loaded.
BoatDetails.cmp
BoatDetailsController.js
@Pat_McClellan
Below code now shows the Boat Details :
Give it a try.
So my markup now looks like this: Thanks for your collaboration. See you on the next step!
I am getting below Error while checking the challenge 6,
if possible please share BoatDetail.cmp and controller code to check,
But i have included the lightning button with onFullDetails event with controller method.
here is my code:
kinldy share boatDetail.cmp and controller.
Thanks in Advance
Karthik
i solved the error by adding the <aura:set> now i am getting different error. eventhough i added the controler method,
can you share your controller code of Boatdetailcontroller.JS
Thanks in advance
Thanks
karthik
Use below updated code
BoatDetail.cmp ( added lingtning button in set attribute)
hope this will work for you.
Thanks
karthik
At last crossed stage 6.
Thanks
kartik
Use below updated code. you have to check event is supported by deployment platform or not. if yes display button. else no.
hope this will help you
Thanks
karthik
@Pat_McClellan
BoatDetail Component. See in my component how i handled the Full Details Button.
When it should be
See the difference between id and Id.
Anoop
Markup:
Controller: I actually tried to move the returned function into an attribute with type="Function" but that did't work. Still don't understand why not.
So similar to:
And in the controller:
Hope this helps.
Oh yeah, this also did not pass:
Jeroen
I'm also having issue with this step, the application event is not triggering the method is the handler...
I have started a new thread about this :
https://developer.salesforce.com/forums#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Developer_Forums&criteria=OPENQUESTIONS&id=9060G0000005OTXQA2
could you please have a look ? this is a bit frustrating ;)
thanks a lot !
Finally found what was blocking the application event reception.
It seems that an application event doesn't require a name in its handler, so by changing : to in BoatDetails.cmp, it is now working.
Hope it will help others.
Below is my code for BoatDetail.cmp -
<aura:component access="global" implements="force:appHostable,flexipage:availableForAllPageTypes">
<aura:attribute name="boat" type="Boat__c" access="public"/>
<lightning:card iconname="utility:anchor" ><!--title="{!v.boat.Contact__r.Name+'\'s Boat'}" >-->
<aura:set attribute="actions">
<lightning:button label="Full Details" onclick="{!c.onFullDetails}" />
</aura:set>
<aura:set attribute="title">
{!v.boat.Contact__r.Name}'s boat
</aura:set>
<p class="slds-p-horizontal_small">
<lightning:layout>
<lightning:layoutItem flexibility="grow" size="6" mediumDeviceSize="6" largeDeviceSize="6">
<div class="slds-p-horizontal--small">
<div class="boatproperty">
<span class="label">Boat Name:</span>
<span>{!v.boat.Name}</span>
</div>
<div class="boatproperty">
<span class="label">Type:</span>
<span>{!v.boat.BoatType__r.Name}</span>
</div>
<div class="boatproperty">
<span class="label">Length:</span>
<span>{!v.boat.Length__c} ft</span>
</div>
<div class="boatproperty">
<span class="label">Est. Price:</span>
<span><lightning:formattedNumber style="currency" currencyCode="USD" value="{!v.boat.Price__c}"/></span>
</div>
<div class="boatproperty">
<span class="label">Description:</span>
<span><lightning:formattedRichText value="{!v.boat.Description__c}" /></span>
</div>
</div>
</lightning:layoutItem>
<lightning:layoutItem flexibility="grow" size="6" mediumDeviceSize="6" largeDeviceSize="6">
<div class="imageview" style="{!'background-image:url(\''+v.boat.Picture__c+'\')'}" />
</lightning:layoutItem>
</lightning:layout>
</p>
</lightning:card>
</aura:component>
Issue you mentioned in your last comment related to BoatDetail component css.
Please update your BoatDetail.css as suggested in "Display Boat Details" section. Hope this will resolve your issue.
So I tried submitting it in Trailhead to see if they'd give me a helpful error and it just said I had passed. I'm stumped and hoping for some help. Thanks!
Can some one please help me out with the below issue.
This challenge ipoint s really annoying. More even than other testing requirements that are absurdly codified.
The text says:
<<The card’s header is the Boat Contact’s name, concatenated with “’s Boat.”>>
But the testing is done with the apostrophe char and without an ending dot: 's boat
Salesforce test couldn't even take it from the cards' inlne title
title="{!v.boat.Contact__r.Name + '\'s boat'}"
Challenge Not yet complete... here's what's wrong:
The BoatDetails component's tabs shouldn't display if the component’s boat attribute is undefined. Either use the empty function or check for undefined.
Please help
The BoatDetails component's tabs shouldn't display if the component’s boat attribute is undefined. Either use the empty function or check for undefined.