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
John Lay 9John Lay 9 

Connect Components with Events unable to check challenge with Name field using an inputText UI component.

I'm trying to complete the Connect Components with Events trailhead and am getting this message when checking the challenge:

Challenge Not yet complete... here's what's wrong: 
The campingList component doesn't have a Name field using an inputText UI component.

This does not make sense to me as this challenge moved the input form to a new bundle. Why does it seem to want a inputText UI component in the campingList component?

I am using an inputText UI control in the form component and including the component on the CampingList component.

I feel I'm missing a step.  Ideas?

Thanks.
Best Answer chosen by John Lay 9
John Lay 9John Lay 9
Well, go figure... they wanted the action name to be submitForm.

All Answers

John Lay 9John Lay 9
Ok, cleaned up code and got past the Name Field error (was the moving of the newItem attribute from List to Form components)

Now I have this error:

Challenge Not yet complete... here's what's wrong: 
The campingListForm component isn't using the 'submitForm' controller action for the button press.

Here is the code for the submit button and the controller....
 
<div class="slds-form-element">
          <ui:button label="Create Item"
              class="slds-button slds-button--brand"
              press="{!c.clickCreateItem}"/>
      </div>

clickCreateItem : function(component, event, helper) {
        var item = component.get("v.newItem");
        
        var namefield = component.find("Name");
        var n = namefield.get("v.value");
        
        var qtyField = component.find("quantity");
        var qty = qtyField.get("v.value");
        
        var prcField = component.find("price");
        var p = prcField.get("v.value"); 

        
        var validItem = true;
        
        if($A.util.isEmpty(n) ) {
            validItem = false;
            namefield.set("v.errors",[{message:"Item name can't be blank."}]);
        } elseif($A.util.isEmpty(qty) || $A.util.isEmpty(p)) {
            validItem = false;
            qtyField.set("v.errors", [{message:"Quantity can't be blank."}]);
    	} elseif($A.util.isEmpty(p) ) {
            validItem = false;
            prcField.set("v.errors", [{message:"Price can't be blank."}]);

		}
        if(validItem){
        	helper.createItem(component, item);
        }

		
	}

Any ideas as to my issue?
John Lay 9John Lay 9
Well, go figure... they wanted the action name to be submitForm.
This was selected as the best answer
Andrew Taylor 13Andrew Taylor 13
Thanks for posting this, just got this error myself :)
MattEvansMattEvans
How annoying is that. They need to have the tests checking for input and result of the exercise and then check if certain components where created. Sure some people might cheat but if the exercises where building one ontop of the other, if people cheat they won't pass the whole module.
Quang Tran NhatQuang Tran Nhat
For the error message "Challenge Not yet complete... here's what's wrong: 
The campingListForm component isn't using the 'submitForm' controller action for the button press."

Please Add more on:

CampingListForm.cmp

<div class="slds-form-element">
              <ui:button label="Submit Form"
                  class="slds-button slds-button--brand"
                  press="{!c.submitForm}"/>
          </div>

CampingListFormController.js

submitForm : function(component, event, helper) {
        
        var validCamping = true;

        // Name must not be blank
        var nameField = component.find("name");
        var expname = nameField.get("v.value");
        if ($A.util.isEmpty(expname)){
            validCamping = false;
            nameField.set("v.errors", [{message:"Camping Item name can't be blank."}]);
        }
        else {
            nameField.set("v.errors", null);
        }

        
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        if ($A.util.isEmpty(price) || isNaN(price) || (price <= 0.0)){
            validCamping = false;
            priceField.set("v.errors", [{message:"Camping Item price can't be blank."}]);
        }
        else {
            priceField.set("v.errors", null);
        }
        
        var quantityField = component.find("quantity");
        var quantity = quantityField.get("v.value");
        if ($A.util.isEmpty(quantity) || isNaN(quantity) || (quantity <= 0)){
            validCamping = false;
            quantityField.set("v.errors", [{message:"Camping Item quantity can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }

        if(validCamping){
            
            helper.createItem(component);
            
        }
        
    }


Hope this will help
Mark Maslow 4Mark Maslow 4
I'm having exactly this issue (quoted below).

Everything actually works just fine, but I can't manage to get past the challenge. As the original poster said, the error message makes no sense, since I thought the point of the exercise is to put the UI component into the campingListForm component - yet the error is pointing to the campingList component.

Anyone know what's up with this?


I'm trying to complete the Connect Components with Events trailhead and am getting this message when checking the challenge:

Challenge Not yet complete... here's what's wrong: 
The campingList component doesn't have a Name field using an inputText UI component.

This does not make sense to me as this challenge moved the input form to a new bundle. Why does it seem to want a inputText UI component in the campingList component?

I am using an inputText UI control in the form component and including the component on the CampingList component.