+ Start a Discussion
Sean Fife 16Sean Fife 16 

Lightning Component Framework Specialist - Step 7 input error

I'm getting this error:
User-added image
And I don't have a clue why, any insights/help?  The xml is below with everything it says to check being, to my knowledge, correct.  The review does work, if I enter one and press the submit button it does save and change the tab.
 
    <aura:attribute name="review" type="BoatReview__c" access="private" />
    <aura:attribute name="boatReview" type="BoatReview__c" access="private" />
    <aura:attribute name="recordError" type="String" access="private" />
    
    <force:recordData aura:id="service"
                      layoutType="FULL"
                      fields="Id,Name,Comment__c,Boat__c"
                      mode="EDIT"
                      targetRecord="{!v.review}"
                      targetFields="{!v.boatReview}"
                      targetError="{!v.recordError}" />
    
    <lightning:layout verticalAlign="start" multipleRows="true">
        <Lightning:layoutItem flexibility="auto" padding="around-small">

            <lightning:input name="reviewtitle" label="Title" value="{!v.boatReview.Name}" />

        </Lightning:layoutItem>
        <Lightning:layoutItem flexibility="auto" padding="around-small">
            <label>Description</label>
            <lightning:inputRichText aura:id="reviewcomment" value="{!v.boatReview.Comment__c}" />
        </Lightning:layoutItem>
        <Lightning:layoutItem flexibility="auto" padding="around-small">
            &nbsp;rating&nbsp;
        </Lightning:layoutItem>
        <Lightning:layoutItem flexibility="auto" padding="around-small">
            <lightning:button iconName="utility:save" onclick="{!c.onSave}" label="Submit"/>
        </Lightning:layoutItem>
    </lightning:layout>



 
Best Answer chosen by Sean Fife 16
Sean Fife 16Sean Fife 16
I was wrong, it's not a generic error, but it is a terrible error message.

The issue was that the name of the lightning:input needed be "title".  Same with the comment, the aura:id needed be "comment".  After I made those changes it passed. Apparently, your attribute for changing the tab must be named "selectedTabId" as well or it can't tell the tab changes.

This is kind of a big deal becuase it's a requirement to pass, but not in the requirements. It's especially a big deal becuase in other spots it requires an id with a specific name.  I can see a lot of people naturally giving those ids, but if it's required, the spec needs to say it's required.  If it's not required, there's a bug in whatever the "complete step" does.

All Answers

Sean Fife 16Sean Fife 16
That image is a little small.  The error text is:

"The lightning:input for the title field in AddBoatReview.cmp isn't functioning as intended. Make sure all of its required attributes are filled out and that its value attribute is bound to BoatReview__c.Name using the concise syntax corresponding to the targetFields attribute of force:recordData."

Anyhow, I decided to delete the component and recreate it.  In doing so, I did the "check step" just after creating the component, adding the boat attritube, and adding the component to BoatDetails.  I was hoping for a different error.  To be clear, the lightning:input componenet didn't even exist at this point.  The "check step" message I got was the same exact error - not something more helpful like it's missing the lightning:input component, or you're missing the layout, or there's no recordData.  Nope.  The title input doesn't work it tells me.

So, it seems this error is a catchall that's displayed when it doesn't know what's wrong, and now I see this as being broken and/or it's super persnickety.  For all I know I've done something against their esoteric best practices.
Sean Fife 16Sean Fife 16
I was wrong, it's not a generic error, but it is a terrible error message.

The issue was that the name of the lightning:input needed be "title".  Same with the comment, the aura:id needed be "comment".  After I made those changes it passed. Apparently, your attribute for changing the tab must be named "selectedTabId" as well or it can't tell the tab changes.

This is kind of a big deal becuase it's a requirement to pass, but not in the requirements. It's especially a big deal becuase in other spots it requires an id with a specific name.  I can see a lot of people naturally giving those ids, but if it's required, the spec needs to say it's required.  If it's not required, there's a bug in whatever the "complete step" does.
This was selected as the best answer
Johan KarlsteenJohan Karlsteen
@Sean, thanks for saving me time debugging. I was missing the name field.
Navanit KambleNavanit Kamble
Thanks man
SForceBeWithYouSForceBeWithYou

Only thing missing for me was name="title"

<lightning:input name="title" label="Title" value="{!v.boatReview.Name}" />
<lightning:inputRichText label="Description" value="{!v.boatReview.Comment__c}" disabledCategories="FORMAT_FONT" />
May The SForce Be With You, superbadge padawans!