我需要将像 #{bean.userProfile} 这样的参数传递给支持 bean 中像clear(UserProfile profile)这样的方法。
<a4j:commandButton value="Cancel" onclick="#{rich:component('id_up')}.hide()" execute="@this" type="reset" action="#{profilesBean.clear()}" render="id_panel">
我正在寻找在操作中编写类似内容的语法:
action="#{profilesBean.clear(#profilesBean.selectedProfile)}"
我需要通过“selectedProfile”发送所有 userProfile 属性。
最佳答案
如果您使用 EL2.2,那么您可以使用与您预期非常相似的语法(第二个 # 应删除):
action="#{profilesBean.clear(profilesBean.selectedProfile)}"
关于java - jsf:将参数传递给支持 bean 中的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24316267/