• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about how page navigation should be handled

 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am going to have multiple pages with three content panes - a project explorer on the left, some horizontal tabs along the top, and the rest of the screen is the majority, and will be the main content pane. So the only thing that will change is going to be this main content pane (which is determined by what the user clicks on from the project explorer or tabs). The project explorer and tabs are going to be the same across the different pages (although project explorer does change depending on the user, and as the user adds new projects etc)

So lets say when a user first logs in he sees the default view, lets call it www.mdn.com/index.jsf. Then this user clicks on one of the tabs, which changes only that main content pane. Is/should this change the actual url, or will it be considered the same url, and it is just that the page changes dynamically? In other words, when this main content pane changes will the url still be www.mdn.com/index.jsf? Or would it change to something like www.mdn.com/tab_one.jsf?

If both are possible which is recommended? Which would save more memory? I do know we will need at least some unique urls, but not all of it needs to be unique.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
URLs in JSF are relatively meaningless. It's a major complaint, since you can't bookmark or favorite them. A JSF URL is more like a handle on a conversation than it is an actual web request. You can initially request a page with a URL, but after that, the form editing is managed by a set of postbacks, and if you'll notice, often the original URL is still displayed in your browser even after the actual page content has shifted to a different JSF form entirely.

Adding better support for URL-based navigation is one of the goals of JSF 2.0. In the mean time, when you need an actual bookmarkable URL, consider using PrettyFaces. It's a fairly simple way to make bookmarkable URLs and as a side benefit also allows the processing of JSF HTTP Get Requests without you having to write explicit code burrrowing into FacesContext just to get the URL parameters.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic