Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-page app guide #159

Open
MFKoelmans opened this issue Sep 29, 2013 · 3 comments
Open

Multi-page app guide #159

MFKoelmans opened this issue Sep 29, 2013 · 3 comments

Comments

@MFKoelmans
Copy link

The sproutcore framework provides classes like SC.Pane and SC.Page which probably work great, but how to swap those, and when to use which, is not clear to me. SC.routes could be integrated into the guide on pages and panes as well, I've only seen a third party tutorial about this, using SC 1.4.2, which is, AFAIK outdated.

@dcporter
Copy link
Member

Agreed on all points. A few preliminary answers (I know, here rather than in a guide):

  • SC.Page is badly named, and has nothing to do with metaphorical web pages. Its sole purpose is to hold pane and view classes (or designed instances – basically views that you've extended or designed but NOT createed), and lazily instantiate them for you the first time you get them. It's a fantastic thing for performance, and is absolutely a best practice, but it's ... yeah, there are no "pages" involved with SC.Page.
  • SC.Pane is just a view class that doesn't require a parentView – it lives at the top of its view tree. The main pane that fills the whole screen and contains the main piece (or a main piece) of your application is appropriately called SC.MainPane. You can only have one MainPane active at a time, and adding one will remove another. My appplications tend to have one main MainPane, and probably a MainPane that's used as the splash-screen during app launch, but if your app has multiple sections (multiple pages, if you will) then having multiple MainPanes is appropriate. Other pane classes are used for things like tool pallets (think photoshop's drag-around toolset windows that hover over top of your workspace), and pop-up modal dialogues, including SC.AlertPane, SC's convenience dialogue box class.
  • Routes, and especially routing statecharts, are one of our great underdocumented features (and we have many!). I've used them but am definitely not an expert; would love to hear here from anyone that is!

So since making guides is easier now, we should definitely work on putting all this into a couple of guides. We should have guides for everything (with some organization of course). Thanks for the questions and ideas!

@MFKoelmans
Copy link
Author

So SC.Page has nothing to do with displaying things, just for 'easy access'?

@dcporter
Copy link
Member

Right. Think of it like optimized storage for your panes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants