我正在使用 JSF 2.0,
我的管理部分有一个表单,我将在其中选择列表中的一些用户。
表单 (selectusers.xhtml) 将这些用户添加到 bean (SelectUsers.java) 中的列表中。
选择一些用户后,我会将用户列表从 SelectUsers.java 传递到另一个 bean (AddAddressBean.java),并继续以另一种形式 (addadress.xhtml) 添加信息,该形式设置其他相关属性为每个用户添加AddressBean。
我不知道如何实施。我希望 AddAddressBean.java 应该是独立的(这样我可以将它与其他 bean 一起使用),所以我更希望 AddAddressBean.java 不知道其他 bean。
你能帮我吗? =)
BR 卡尔
I'm working with JSF 2.0
I have a form in my admin section where I am going to select some users in a list.
The form (selectusers.xhtml) is adding these users to a list in a bean (SelectUsers.java).
After I have selected some user(s), I will pass the list of the user(s) from SelectUsers.java to another bean (AddAddressBean.java) and continue add information in another form (addadress.xhtml) which set other properties related to AddAddressBean for each user.
I do not know how to implement it. I would like that AddAddressBean.java shall be independent (so I can use it together with other beans), so I prefer that AddAddressBean.java shall not know about other beans.
Can you please help me? =)
B.R Carl
发布评论
评论(2)
我很快想到了几件事情:
@ViewAccessScoped
Several quick things come to mind :
@ViewAccessScoped
这就是我的实现方式(正如 @bertie 所说,使用 ConversationScoped )。
豆 1:
豆 2:
This how i implemented (used ConversationScoped as @bertie said ).
bean 1:
bean 2: