• Barry Bakunowicz - Dev
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
Hi i am getting an error while completing the challenge 9 on the superbatch, even though my funtionality is working fine.

Error: 
Challenge Not yet complete... here's what's wrong: 
The BoatReviews component doesn't invoke the FiveStarRating component and bind the value to the Rating__c field of the BoatReview custom object.

BoatReviews.cmp
<aura:component controller="BoatReviews">
	<aura:attribute name="boat" type="Boat__c" access="public"/>
    <aura:attribute name="boatReviews" type="BoatReview__c[]" access="private"/>
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    <aura:handler name="change" value="{!v.boat}" action="{!c.doInit}"/>
     <aura:method name="refresh" action="{!c.doInit}"> 
     </aura:method>
    
    <aura:if isTrue="{!v.boatReviews.length==0}">
    	<lightning:layoutItem class="slds-align_absolute-center" flexibility="auto" padding="around-small">   
              <ui:outputText value="No reviews available" />
        </lightning:layoutItem>
    </aura:if>
  <div class="slds-feed">
	<ul class="slds-feed__list">
         <ui:scrollerWrapper class="scrollerSize">
       <aura:iteration items="{!v.boatReviews}" var="review">
          
		<li class="slds-feed__item slds-scrollable_y">    
    		<article class="slds-post">
            	<header class="slds-post__header slds-media">
                <div class="slds-media__figure">
                    <a href="javascript:void(0);" class="slds-avatar slds-avatar_circle slds-avatar_large">
                        <img alt="{!review.CreatedBy.Name}" src="{!review.CreatedBy.SmallPhotoUrl}" title="{!review.CreatedBy.Name}"  />
                    </a>
                </div>
                <div class="slds-media__body">
                        <div class="slds-grid slds-grid_align-spread slds-has-flexi-truncate">
                            <p><a data-userid="{!review.CreatedBy.Id}" href="javascript:void(0);" title="{!review.CreatedBy.Name}" onclick="{!c.onUserInfoClick}">
                                {!review.CreatedBy.Name}
                                </a> 
                                — {!review.CreatedBy.CompanyName}
                            </p>
                        </div>
                    	<p class="slds-text-body_small">
                            <lightning:formattedDateTime value="{!review.LastModifiedDate}" year="numeric" month="short" day="numeric"  hour="2-digit" minute="2-digit" second="2-digit" />
                    	</p>
                    </div>
            </header>
             <div class="slds-post__content slds-text-longform">
                 <p class="slds-text-title_caps">{!review.Name}</p>
                 
                 <p class="slds-text-body_small"><lightning:formattedRichText value="{!review.Comment__c}"/> </p>
			</div>
             <footer class="slds-post__footer">
	<ul class="slds-post__footer-actions-list slds-list_horizontal">
		<li class="slds-col slds-item slds-m-right_medium">
			<c:FiveStarRating value="{!review.Rating__c}" readonly="true"/>
		</li>
		
	</ul>
                 
</footer>
    		</article>
          </li>
          
        </aura:iteration>
              </ui:scrollerWrapper>
    </ul>
  </div>
</aura:component>

Seems some problem with the lightning markup or CSS, any help will be appritiated 

Hello all,

I'm currently working through Step 7 of the new "Lightning Component Framework Specialist" superbadge, and I'm running into an error while checking the challenge:

"The AddBoatReview controller's onSave() function doesn't fire the BoatReviewAdded event."

The problem is that I'm testing the component right now, and my event is being received by the parent just fine, and my tabset switches to the "Reviews" section like it should, so know it's being handled correctly. I've tried using both a Component event and an Application event just to debug a bit (even though Component is the best option for this scenario), and that doesn't change anything. Any idea what could be triggering this error message?

Relevant code:

AddBoatReviewController.js

onSave : function(component, event, helper){
    	component.set("v.boatReview.Boat__c",component.get("v.boat.Id"));

        component.find("service").saveRecord(function(saveResult) {
            if (saveResult.state === "SUCCESS" || saveResult.state === "DRAFT") {

               var cmpEvent = component.getEvent("reviewAdded");
		       cmpEvent.fire();

               //Attempt at trying an Application event instead
		       //var cmpEvent = $A.get("e.c:BoatReviewAdded");
		       //cmpEvent.fire();


                var resultsToast = $A.get("e.force:showToast");
                //Toast code and other saveResults states below...
AddBoatReview.cmp
<aura:registerEvent name="reviewAdded" type="c:BoatReviewAdded"/>
     
    <!-- Display form -->
    <lightning:layout multipleRows="true">
            <lightning:layoutItem size="12" padding="around-small">
                <lightning:input name="title" label="Title" value="{!v.boatReview.Name}"/>
            </lightning:layoutItem>

            <lightning:layoutItem size="12" padding="around-small">
                <label class="slds-form-element__label" for="input-id-01">Description</label>
                <lightning:inputRichText value="{!v.boatReview.Comment__c}" disabledCategories="FORMAT_FONT"/>
            </lightning:layoutItem>

            <lightning:layoutItem size="12" class="slds-align--absolute-center">
                <lightning:button iconName="utility:save" label="Submit" onclick="{!c.onSave}"/>
            </lightning:layoutItem>
    </lightning:layout>
BoatDetails.cmp
<aura:handler name="reviewAdded" event="c:BoatReviewAdded" action="{!c.onBoatReviewAdded}"/>

BoatDetailsController.js

onBoatReviewAdded : function(component, event, helper) {
	console.log("Event received");
	component.set("v.selTabId", "boatreviewtab");
}
Hi i am getting an error while completing the challenge 9 on the superbatch, even though my funtionality is working fine.

Error: 
Challenge Not yet complete... here's what's wrong: 
The BoatReviews component doesn't invoke the FiveStarRating component and bind the value to the Rating__c field of the BoatReview custom object.

BoatReviews.cmp
<aura:component controller="BoatReviews">
	<aura:attribute name="boat" type="Boat__c" access="public"/>
    <aura:attribute name="boatReviews" type="BoatReview__c[]" access="private"/>
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    <aura:handler name="change" value="{!v.boat}" action="{!c.doInit}"/>
     <aura:method name="refresh" action="{!c.doInit}"> 
     </aura:method>
    
    <aura:if isTrue="{!v.boatReviews.length==0}">
    	<lightning:layoutItem class="slds-align_absolute-center" flexibility="auto" padding="around-small">   
              <ui:outputText value="No reviews available" />
        </lightning:layoutItem>
    </aura:if>
  <div class="slds-feed">
	<ul class="slds-feed__list">
         <ui:scrollerWrapper class="scrollerSize">
       <aura:iteration items="{!v.boatReviews}" var="review">
          
		<li class="slds-feed__item slds-scrollable_y">    
    		<article class="slds-post">
            	<header class="slds-post__header slds-media">
                <div class="slds-media__figure">
                    <a href="javascript:void(0);" class="slds-avatar slds-avatar_circle slds-avatar_large">
                        <img alt="{!review.CreatedBy.Name}" src="{!review.CreatedBy.SmallPhotoUrl}" title="{!review.CreatedBy.Name}"  />
                    </a>
                </div>
                <div class="slds-media__body">
                        <div class="slds-grid slds-grid_align-spread slds-has-flexi-truncate">
                            <p><a data-userid="{!review.CreatedBy.Id}" href="javascript:void(0);" title="{!review.CreatedBy.Name}" onclick="{!c.onUserInfoClick}">
                                {!review.CreatedBy.Name}
                                </a> 
                                — {!review.CreatedBy.CompanyName}
                            </p>
                        </div>
                    	<p class="slds-text-body_small">
                            <lightning:formattedDateTime value="{!review.LastModifiedDate}" year="numeric" month="short" day="numeric"  hour="2-digit" minute="2-digit" second="2-digit" />
                    	</p>
                    </div>
            </header>
             <div class="slds-post__content slds-text-longform">
                 <p class="slds-text-title_caps">{!review.Name}</p>
                 
                 <p class="slds-text-body_small"><lightning:formattedRichText value="{!review.Comment__c}"/> </p>
			</div>
             <footer class="slds-post__footer">
	<ul class="slds-post__footer-actions-list slds-list_horizontal">
		<li class="slds-col slds-item slds-m-right_medium">
			<c:FiveStarRating value="{!review.Rating__c}" readonly="true"/>
		</li>
		
	</ul>
                 
</footer>
    		</article>
          </li>
          
        </aura:iteration>
              </ui:scrollerWrapper>
    </ul>
  </div>
</aura:component>

Seems some problem with the lightning markup or CSS, any help will be appritiated 

Hello all,

I'm currently working through Step 7 of the new "Lightning Component Framework Specialist" superbadge, and I'm running into an error while checking the challenge:

"The AddBoatReview controller's onSave() function doesn't fire the BoatReviewAdded event."

The problem is that I'm testing the component right now, and my event is being received by the parent just fine, and my tabset switches to the "Reviews" section like it should, so know it's being handled correctly. I've tried using both a Component event and an Application event just to debug a bit (even though Component is the best option for this scenario), and that doesn't change anything. Any idea what could be triggering this error message?

Relevant code:

AddBoatReviewController.js

onSave : function(component, event, helper){
    	component.set("v.boatReview.Boat__c",component.get("v.boat.Id"));

        component.find("service").saveRecord(function(saveResult) {
            if (saveResult.state === "SUCCESS" || saveResult.state === "DRAFT") {

               var cmpEvent = component.getEvent("reviewAdded");
		       cmpEvent.fire();

               //Attempt at trying an Application event instead
		       //var cmpEvent = $A.get("e.c:BoatReviewAdded");
		       //cmpEvent.fire();


                var resultsToast = $A.get("e.force:showToast");
                //Toast code and other saveResults states below...
AddBoatReview.cmp
<aura:registerEvent name="reviewAdded" type="c:BoatReviewAdded"/>
     
    <!-- Display form -->
    <lightning:layout multipleRows="true">
            <lightning:layoutItem size="12" padding="around-small">
                <lightning:input name="title" label="Title" value="{!v.boatReview.Name}"/>
            </lightning:layoutItem>

            <lightning:layoutItem size="12" padding="around-small">
                <label class="slds-form-element__label" for="input-id-01">Description</label>
                <lightning:inputRichText value="{!v.boatReview.Comment__c}" disabledCategories="FORMAT_FONT"/>
            </lightning:layoutItem>

            <lightning:layoutItem size="12" class="slds-align--absolute-center">
                <lightning:button iconName="utility:save" label="Submit" onclick="{!c.onSave}"/>
            </lightning:layoutItem>
    </lightning:layout>
BoatDetails.cmp
<aura:handler name="reviewAdded" event="c:BoatReviewAdded" action="{!c.onBoatReviewAdded}"/>

BoatDetailsController.js

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