2

Good afternoon everyone!

I am currently stuck on an issue while developing a desktop Lightning App. Is there currently any native Lightning events or any way to navigate between Lightning components within a desktop Lightning app? All I have been able to do so far is just hide and show the components with jQuery/Javascript. I have only been able to find navigation-related events in the documentation that are only supported for Salesforce1 mobile but not desktop Lightning apps.

I look forward to any information you guys can provide. Thanks!

1

The model I have seen used is creating a content container, some custom events (perhaps called PageChange) and dynamically creating components to fill in that container.

You can learn more about dynamically creating components here: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_dynamic_cmp_async.htm.

When you want to move to a new "page", you create the new component you want to display, and insert it into the running HTML.

There is no easy navigatetocomponent method, alas.

  • Thanks for that link. It seems that method is mainly recommended for creating small components like a button, UI message, etc. – Daniel Fuller Jun 28 '15 at 3:39
  • I'm wondering how that would work if your component was a full section of a page. That's the kind of scenario I am working with. I have a main container component that stores the navigation bar of the page. On each click of the nav tabs, the inner section of the page changes to a different component. The only way I've been able to find to achieve that so far is to hide all the components on page load and the hide and show each component with Javascript. It works but it's just not using anything native to Lightning so I'm not sure how it will affect peformance on mobile yet. – Daniel Fuller Jun 28 '15 at 3:40
  • Well, it definitely works! Why pre-render every component and hide it if the user may never go to that screen? Just set the body of the inner page to a dynamically allocated component. – Christian Carter Jun 28 '15 at 6:04
3

force:navigateToComponent is now available in Beta in Winter '17 and is documented here: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_navigateToComponent.htm

0

At this time Lightning Components are only for Single Page Salesforce1 Mobile Apps. Desktop Apps are reportedly in the development plan at some point in the future, but no time frame has been published. Safe Harbor, etc.

As an FYI, Report Builder functionality is said to have been built on Lightning technology (source: Lightning Webinar Series from Spring 2015).

  • Well, Lightning Components are COMPLETELY usable within Lightning Apps (formerly Lightning Pages). In fact, you MUST use lightning components in order to compose apps, as Daniel has discovered. – Christian Carter Jun 26 '15 at 22:28
  • @ChristianCarter is correct in that Lightning Components are the building blocks of desktop Lightning Apps. They can also be added to the Salesforce1 mobile app but are not as integral as with the desktop apps. – Daniel Fuller Jun 28 '15 at 3:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.