No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Fire the Events
Fire the events in your client-side controller or helper functions. The force events are handled by Salesforce1.
This demo builds on the contacts component you created in Load the Contacts.
-
In the contactList sidebar, click CONTROLLER to create a new
resource named contactListController.js. Replace the
placeholder code with the following code and then save.
-
Refresh the Salesforce1
mobile browser app, and click these elements to test the events.
- Contact name: force:navigateToSObject is fired, which updates the
view with the contact record page. The contact name corresponds to
the following
component.
- Edit Contact icon: force:editRecord is fired, which opens the edit record
page. The Edit Contact icon corresponds to the following
component.
- Address: force:navigateToURL is
fired, which opens Google Maps with the provided url. The address corresponds to the
following
component.
- Contact name: force:navigateToSObject is fired, which updates the
view with the contact record page. The contact name corresponds to
the following
component.
-
Open contactsController.js. After the hideSpinner controller, enter
this code and then save.
Notice that if you pull down the page and release it, the page refreshes all data
in the view. This is similar to running $A.get('e.force:refreshView').fire();.
Now you can test your components by clicking on the areas highlighted in Try It Out: Create a Component that Fires Salesforce1 Events.
For an example on creating a standalone app that can be used independent of Salesforce1, see Create A Standalone Lightning App.