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
JitendraJitendra 

Whats wrong in my solution for Trailhead challenge

For trailhead challenge (https://developer.salesforce.com/trailhead/lightning_components/lightning_components_uiforce), I am using below code. I am not able to figure out whats wrong in below code. I am getting error saying "The component is not using the ui:inputText component"
 
<aura:component >       
    <aura:attribute name="fName" type="String" default="Jitendra"/>
    <aura:attribute name="lName" type="String" default="Zaa"/>
    <aura:attribute name="pNumber" type="String" default="201"/>
    <aura:attribute name="sal" type="String" default="Mr."/>
 
    <ui:inputText label="First Name" value="{!v.fName}" />  
    <ui:inputText label="Last Name" value="{!v.lName}"  /> 
    <ui:inputText label="Phone Number" value="{!v.pNumber}"  />  
    
    <ui:inputSelect multiple="false" label="Salutation" value="{!v.sal}" >
        <ui:inputSelectOption text="Dr." label="Dr." />
        <ui:inputSelectOption text="Mr." label="Mr."/>
        <ui:inputSelectOption text="Mrs." label="Mrs."/>
        <ui:inputSelectOption text="Ms." label="Ms."/>
	</ui:inputSelect> 
    <ui:button label="Submit"/>
</aura:component>

 
Best Answer chosen by Jitendra
joshbirkjoshbirk

The code was fine.  Right now there's a potential conflict between components of similar types.  So if anyone else sees this behavior, delete (under File in Developer Console while on the tab/resource you want to delete) any resource you don't need.  For instance, if there is a component and a design resource, delete the design resource and then test against the component again.

Hotfix in the hopper, will be made live in as much two-weeks-before-Dreamforce speed we can muster.

All Answers

William TranWilliam Tran
The component must be called 'RegistrationForm'.
--> Okay,  I assume you'll save it as 'RegistrationForm'.

The form must contain UI components with the following labels: 'First Name', 'Last Name', 'Salutation', 'Phone Number'.
-->Okay
The form must use the appropriate component for the type of input.
-->Phone number should be changed to : <ui:inputPhone label="Phone Number" value="{!v.pNumber}"  />

The 'Salutation' input must be a drop-down list with options such as Dr., Mr., Mrs. and Ms.
-->Okay

The form must also include a button labeled 'Submit'.

--> Okay, but you should add an id  such as <ui:button aura:id="outputButton" label="Submit" />


As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you. 

Thanks
JitendraJitendra
Thanks for reply WIlliam, its still not working. I tried below code , not sure if anyone else is facing this issue :
 
<aura:component >       
    <aura:attribute name="fName" type="String" default="Jitendra"/>
    <aura:attribute name="lName" type="String" default="Zaa"/>
    <aura:attribute name="pNumber" type="String" default="2017899635"/>
    <aura:attribute name="sal" type="String" default="Mr."/>
 
    <ui:inputText aura:id="fName" label="First Name" value="{!v.fName}" />  
    <ui:inputText aura:id="lName" label="Last Name" value="{!v.lName}"  /> 
    <ui:inputPhone aura:id="phnNum" label="Phone Number" value="{!v.pNumber}"  />  
    
    <ui:inputSelect aura:id="salutation"  multiple="false" label="Salutation" value="{!v.sal}" >
        <ui:inputSelectOption text="Dr." label="Dr." />
        <ui:inputSelectOption text="Mr." label="Mr."/>
        <ui:inputSelectOption text="Mrs." label="Mrs."/>
        <ui:inputSelectOption text="Ms." label="Ms."/>
	</ui:inputSelect> 
    <ui:button label="Submit" aura:id="btnSubmit"/>
</aura:component>

 
William TranWilliam Tran
What is the error message?

Try this;
 
<aura:component >       
    <aura:attribute name="fName" type="String" default="Jitendra"/>
    <aura:attribute name="lName" type="String" default="Zaa"/>
    <aura:attribute name="pNumber" type="String" default="2017899635"/>
    <aura:attribute name="sal" type="String" default="Mr."/>
 
    <ui:inputText aura:id="fNameinput" label="First Name" value="{!v.fName}" />  
    <ui:inputText aura:id="lNameinput" label="Last Name" value="{!v.lName}"  /> 
    <ui:inputPhone aura:id="phnNuminput" label="Phone Number" value="{!v.pNumber}"  />  
    
    <ui:inputSelect aura:id="salutation" label="Salutation" value="{!v.sal}" >
        <ui:inputSelectOption text='Dr.'/>
        <ui:inputSelectOption text='Mr.'/>
        <ui:inputSelectOption text='Mrs.'/>
        <ui:inputSelectOption text='Ms.'/>
	</ui:inputSelect> 
    <ui:button label="Submit" aura:id="btnSubmit"/>
</aura:component>

Also, try log out and log back in.  Sometimes it already passed and you try to submit again so it gives you an error, but next time you log in it showed passed.

Thanks
JitendraJitendra
its giving same error - The component is not using the ui:inputText component
Chandra Sekhar CH N VChandra Sekhar CH N V
Try this code :
<aura:component >
    <ui:inputText label="First Name"/>
    <ui:inputText label="Last Name"/>
    <ui:inputPhone label="Phone"/>
    <ui:inputSelect label="Salutation">
        <ui:inputSelectOption value="Dr."></ui:inputSelectOption>
        <ui:inputSelectOption value="Mr."></ui:inputSelectOption>
        <ui:inputSelectOption value="Mrs."></ui:inputSelectOption>
        <ui:inputSelectOption value="Ms."></ui:inputSelectOption>
    </ui:inputSelect>
   <ui:button label="Submit"></ui:button>
</aura:component>

 
joshbirkjoshbirk

The code was fine.  Right now there's a potential conflict between components of similar types.  So if anyone else sees this behavior, delete (under File in Developer Console while on the tab/resource you want to delete) any resource you don't need.  For instance, if there is a component and a design resource, delete the design resource and then test against the component again.

Hotfix in the hopper, will be made live in as much two-weeks-before-Dreamforce speed we can muster.

This was selected as the best answer
joshbirkjoshbirk
Although yes, "ui:inputPhone" was required (just to note)...
Ishwar KabraIshwar Kabra
@joshbirk removing design component worked for me! Thanks..
M ParnellM Parnell
@Chandra Sekhar CH N V that worked for me. Thanks!