Hello!
I create a bean object in the main MyPostsBean and add it to the ViewMap like this:
Category_MY_POSTS bean = (Category_MY_POSTS) EnumBusinessCategories.getCategoryClass(EnumPackageCategories.MYPOSTS.name(), category); CommonUtils.addToView(EnumBusinessCategories.getBeanName(EnumPackageCategories.MYPOSTS.name(), category), bean); Next, I get this object and execute the query:
Category_MY_POSTS bean = (Category_MY_POSTS) CommonUtils.getFromView(EnumBusinessCategories.getBeanName(EnumPackageCategories.MYPOSTS.name(), category)); bean.selectList_userPosted(); The request is executed and the offersList bean field is offersList . The bean is inherited from the POJO class in which this list is declared.
The problem is that in XHTML the method myOffers.offersList does not return to me the previously assigned offerList . I tried to debug and found that the hash of the bean during the assignment of the list is different from the hash during its retrieval.
@ManagedBean(name = "myPostsBean") @ViewScoped public class MyPostsBean extends MyPostsPOJO implements Serializable { private static final long serialVersionUID = -1573342923390687013L; public MyPostsBean() throws UnsupportedEncodingException { ... String currentCategory = (String) CommonUtils.getRequestValue("category"); if(CommonUtils.getSessionValue(BundleConstants.USERID)!=null){ selectList_userPosted(currentCategory); } ... } } @ManagedBean(name="myOffers") @ViewScoped public class OfferBean extends OfferPOJO implements Category_MY_POSTS, Serializable { @Override public String selectList_userPosted() throws IOException { offersList = OfferBO.getInstance().selectList_userPosted(); return ""; } } public class OfferPOJO extends CommonPOJO { protected List<Map<String, Object>> offersList = new ArrayList<>(); public List<Map<String, Object>> getOffersList() { return offersList; } }