function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shubham saini 14Shubham saini 14 

I am getting this error in superbadge step 7 The BoatDetails controller's onBoatReviewAdded function doesn't set the currently selected tab to "Reviews".

/*** BoatDetails.cmp ***/

<aura:component implements="flexipage:availableForAllPageTypes" access="global">
    <aura:attribute name="boat" type="Boat__c" />
    <aura:attribute name="id" type="Id" />
    <aura:attribute name="simpleRecord" type="Object" />
    <aura:attribute name="recordError" type="String" />
    <aura:attribute name="selTabId" type="String" />
    <aura:handler event="c:BoatSelected" action="{!c.onBoatSelected}" />
    <aura:handler name="BoatReviewAdded" event="c:BoatReviewAdded" action="{!c.onBoatReviewAdded}" />
    <force:recordData aura:id="service"
      recordId="{!v.id}"
      fields="Id,
              Name,
              Description__c,
              Price__c,
              Length__c,
              Contact__r.Name,
              Contact__r.Email,
              Contact__r.HomePhone,
              BoatType__r.Name,
              Picture__c"
      mode="VIEW"
      targetRecord="{!v.boat}"
      targetFields="{!v.simpleRecord}"
      targetError="{!v.recordError}"
      recordUpdated="{!c.onRecordUpdated}"
      />
    <aura:if isTrue="{! !empty(v.boat)}">
        <lightning:tabset aura:id="details" selectedTabId="{!v.selTabId}">
            <lightning:tab label="Details" id="Details">
                <c:BoatDetail boat="{!v.simpleRecord}" />
            </lightning:tab>
            <lightning:tab label="Reviews" id="boatreviewtab">
                <c:BoatReviews boat="{!v.boat}" aura:id="BR" />
            </lightning:tab>
            <lightning:tab label="Add Review" id="addReview">
                <c:AddBoatReview boat="{!v.boat}" aura:id="ABR" />
            </lightning:tab>
        </lightning:tabset>    
    </aura:if>
</aura:component>

/*** BoatDetailsController ***/

 onBoatReviewAdded : function(component, event, helper) {
        component.set("v.selTabId","boatreviewtab");
    },

SandhyaSandhya (Salesforce Developers) 
Hi,

Try setting the selected tab directly from the "onBoatReviewAdded" function in your controller.Also refer below link.

https://developer.salesforce.com/forums/?id=9060G000000MUPFQA4
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
 
Best Regards
Sandhya
 
Shubham saini 14Shubham saini 14

hi sandhya,

No, it's not working .if any other way to solve this please inform me.

 

Thank you