@SessionScoped
public SessionClass{
// Buyer is a view scoped class
private List<Buyer> sessionObject = new ArrayList<Buyer>();
}
When updating a input field buyer.fname. The list is also updated.
Should I change the Buyer class to session scope also.
This has nothing to do with JSF scopes, but everything with the object oriented nature of Java. Apparently the view scoped
Buyerinstance represents exactly the same reference as the item in the list of the session scoped bean (it’s however beyond me how you coded it like that; it would have been explainable ifBuyeris actually a JPA entity).You should be creating a copy of the
Buyerinstance instead or detach the entity if it’s indeed a JPA entity.