I am unsure whether I should:
- Make one view where I use view-parameters
- Or make one view (seperate xhtml page) for each action
The list I have now displays all the questions that I have in the database, and I have added three buttons that currently toggle between ‘All’, ‘With image’ or ‘Without’.
Now I also want to toggle between ‘Submitted’, ‘Approved’ and ‘Rejected’, and possible still have the option to toggle between showing all questions, only with images or without images.
I can make one backing bean and one view for each, or I could do something like this:
www.someurl.com/path/questionlist.xhtml?toggle=all&status=approved
It’s a matter of taste but i like to think of path parameters as distinguishing between different resources and of request params as of options.
So if your ‘submitted’, ‘approved’ and ‘rejected’ questions are separate entities do separate views for them.
You can experiment with path variables and friendly urls and use
to list all questions and
and use ‘all’, ‘with image’ and ‘without’ as parameters (as they don’t esentially change what you’re viewing just how you view it).
If not, use them all as parameters.