java - jsf:将参数传递给支持 bean 中的方法

标签 java jsf richfaces

我需要将像 #{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/

相关文章:

java - 如何匹配双引号中的值?

java - Spring JPA @Query注解,SQL地理定位错误

java - glassfish 服务器上的 "Can' t find bundle for base name messages, locale ar_EG"异常是什么?

jsf - 执行 p :commandLink action before onclick event?

java - p :confirm dialog's OK ignored in Chrome 74

css - JSF - 为弹出面板创建覆盖

javascript 数组和 jsf/richfaces

java - 将混合数组中的值相乘

java - 尝试为象限 I 绘制轴,却得到象限 IV

java - 如果请求超过 1.5 秒,则不会显示 RichFaces 建议框