You need to sign in to do that
Don't have an account?
TrailHead -Error The 'PhoneNumberEvent' event is not of type 'APPLICATION'.
I am doing the Handling Events with Client-Side controllers for the Lightning components study. I created the following:
the javascript modules : PhoneNumberInput and PhoneNumberOutput
The phone number input file contains
<aura:component >
<aura:registerEvent name="PhoneNumEvent" type="c:PhoneNumEvent"/>
<ui:inputPhone aura:id="phone" label="phone" />
<ui:button label="Show Phone" press="{!c.postphone}" />
</aura:component>
The event fle PhoneNumberEvent.evt - I believe that this is the file name I was supposed to use.
and the application file PhoneNumber.app - Not sure what file name to use.
Everything runs fine, the problem is when I check the results I get the error:
Challenge not yet complete... here's what's wrong:
The 'PhoneNumberEvent' event is not of type 'APPLICATION'.
the javascript modules : PhoneNumberInput and PhoneNumberOutput
The phone number input file contains
<aura:component >
<aura:registerEvent name="PhoneNumEvent" type="c:PhoneNumEvent"/>
<ui:inputPhone aura:id="phone" label="phone" />
<ui:button label="Show Phone" press="{!c.postphone}" />
</aura:component>
The event fle PhoneNumberEvent.evt - I believe that this is the file name I was supposed to use.
and the application file PhoneNumber.app - Not sure what file name to use.
Everything runs fine, the problem is when I check the results I get the error:
Challenge not yet complete... here's what's wrong:
The 'PhoneNumberEvent' event is not of type 'APPLICATION'.
<aura:registerEvent name="PhoneNumberEvent" type="c:PhoneNumberEvent"/>
NOT
<aura:registerEvent name="PhoneNumEvent" type="c:PhoneNumEvent"/>
Are you able to complete the challenge ?
I recreated the code as follows:
The new event file is named PhoneNumEvent.evt
PhoneNumberInputController.js
-------------------------------------------
postphone : function(component, event, helper) {
var PhoneNumEvent = component.getEvent("PhoneNumEvent");
var phone = component.find("phone").get("v.value");
PhoneNumEvent.setParams({
"phone": phone
});
PhoneNumEvent.fire();
}
---------------------------------------
PhoneNumberInput.cmp
---------------------------------------
<aura:registerEvent name="PhoneNumEvent" type="c:PhoneNumEvent"/>
<ui:inputPhone aura:id="phone" label="phone" />
<ui:button label="Show Phone" press="{!c.postphone}" />
--------------------------------------
PhoneNumberOutput.cmp
---------------------------------------
<aura:component >
<aura:attribute name="number" type="String" default="No Phone Number"/>
<c:PhoneNumberInput PhoneNumEvent="{!c.phonenum}"/>
<ui:outputText aura:id="phone" value="{!v.number}"/>
</aura:component>
----------------------------------------------------
PhoneNumberOutputController.js
----------------------------------------------------
({
phonenum : function(component, event, helper) {
var phone = event.getParam("phone");
component.set("v.number", phone);
}
})
This is all being started by an app:
PhoneNumber.app
--------------------------------------
<aura:application >
<c:PhoneNumberOutput />
</aura:application>
and Now I am getting this error:
The 'PhoneNumberOutput' component is not using a handler component
From the error you can conclude that event handler not added to the output component "PhoneNumberOutput.cmp"
Add the <aura:handler> tag to PhoneNumberOutput component and try again.
error
Failed to save undefined: : org.auraframework.util.json.JsonStreamReader$JsonStreamParseException: Invalid literal value [1, 1]: 'postphone': Source
I am also getting the same error while trying to implement the Trailhead sample code from the module "Using Standard and Force.com Components".
Here is the Component code - and Component Client Controller code -
Here is the error:
ERROR: : org.auraframework.util.json.JsonStreamReader$JsonStreamParseException: Invalid literal value [1, 1]: 'getInput': Source
Did you get any solution for your error?
Thanks,
Nilesh Dethe
https://developer.salesforce.com/forums/?id=906F0000000BH44IAG