This should be a basic question, but being relatively new to JSF, I cant work out how this use case is supported.
I have a tabbed application, a tab with a list of entities ( tab 1 ), and when an entity is selected, it opens in a new tab to be edited ( tab 2 ), with the associated backing bean ( This works fine ). However I also want to be able to open another entity ( tab 3 ), this is the same type, e.g. same backing bean. This causes all sorts of 'fun' where by tab 2 now displays the content of the bean from tab 3, as its the same backing bean. ( and a heap of ID issues ).
How can I generate two beans of the same type ? I guess its down to scopes ?
You can use the same class and have multiple instances. However, each instance has to have a distinct name. You can do that by defining the bean (and its name) in the faces-config.xml file. You can't use the annotation mechanism instead since only one name can be mapped to a bean via annotation.
I think more likely what you need is a common backing bean that has a collection of "tab beans" where the tab beans are non-JSF POJOs. If we call the backing bean "containerBean" and the collection is contained in a Map object that's a property of that bean, you can reference the individual "tab beans" by name.
Or, if you prefer to use a List as the tab bean container:
Admittedly this is a relatively cumbersome notation, but it should do the job.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.