Hello there!
Im having trouble refreshing a datamodel. I have an action, that have two datamodels as flow:
@Scope(ScopeType.SESSION)
@Name("manageUsers")
public class ManageUsersAction implements ManageUsers {
...
@DataModel(value="usersToManageList", scope=ScopeType.PAGE)
private List<UserBean> usersToManageList;
//Roles
@DataModel(value="rolesWrapperList", scope=ScopeType.PAGE)
private List<RoleWrapperBean> rolesWrapperList;
@DataModelSelection(value="usersToManageList")
@Out(required=false, scope=ScopeType.PAGE)
@In(create=true)
private UserBean userBean;
@DataModelSelection(value="rolesWrapperList")
@Out(required=false)
private RoleWrapperBean selectedRole;
@Factory(value="usersToManageList")
public void getUsersList() {
.....
}
@Factory(value="rolesWrapperList")
public void findRolesList() {
....
}
I want that the usersToManageList and rolesWrapperList be refreshed each time the page is refreshed or reloaded. if i mark the just one of the DataModel with the PAGE scope, it works fine. When the page is loaded for the first time, both of the factory methods (getUsersList, findRolesList) are called. but if i mark the 2 of them with the PAGE scope, both are called when the page is loaded for the firt time, but when is refreshed just the rolesWrapperList is called. (I can see it with the debugger). I want both to be called.
Does any one knows why? Does any one know how to create a method on a action that is called on the begin on the instantiation (every time the page is loaed/reloaded)?
Thaks a lot