0

I have started developing JSF(2.2 + primefaces 6.0) application and my requirement here is that i have search page from starting point, and when I've found user I need to manipulate with only that account. So It's like administrative application. My question how I need to organize my scopes, what Is the best practices for such case?

What I have now:

  1. Working search page, where I got needed id of account.
  2. A link from datatable, that opens a new page with GET parameter (accountId).

So now I wonder what scope should I use for working with account page? This working page will have links to manipulating options to another pages and will be like administrative big menu. Will it be right to use PageFlow? Can I use CDI ConversationScope? Or I just need SessionScope for that? And now, when managed beans will be deprecated i want to use only CDI beans.

I need to monitor which user is working with particular account and should save administrativeUserId for each invoked operation on account. And i need to save an accountId while working with that account despite having to open different options which means different pages.

Thanks in advance!

Izbassar Tolegen
  • 1,990
  • 2
  • 20
  • 37
  • I think I would just start with ViewScoped, and if that gave problems (for example performance) move to a broader scope. The "another pages" might also just be dialogs – Jaqen H'ghar Sep 21 '16 at 06:50
  • @JaqenH'ghar when user will open some option with chosen account, this will lead to open new page - and so - to new view. and my previous view is gone at that point. i cant perform another option with chosen account. – Izbassar Tolegen Sep 21 '16 at 08:13
  • But if you plan to use get for all navigation you will have accountid in the url of all pages (and they will be bookmarkable). You'll have accountid in every bean and can just build your links as you like. And when you click back browser will just fire same get request again, which to me seems not a problem unless the page is slow to load – Jaqen H'ghar Sep 21 '16 at 09:23

0 Answers0