- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的 JSF 项目中使用 Passthrough 元素,需要做类似的事情:
<h:commandLink action="#{myBean.acao()}" value="click me">
<f:setPropertyActionListener target="#{myBean.object}" value="#{localObject}"/>
</h:commandLink>
<a href="#" jsf:action="#{myBean.acao()}">click me
<f:setPropertyActionListener target="#{myBean.object}" value="#{localObject}"/>
</a>
<f:setPropertyActionListener> Parent is not of type ActionSource, type is: com.sun.faces.component.PassthroughElement
最佳答案
看起来只是您的 Mojarra 版本中的一个错误。它适用于当前最新的 2.2.12 版本。
您可以通过使用传递方法参数的 EL 2.2 特性来解决它。另见 Invoke direct methods or methods with arguments / variables / parameters in EL .它肯定在您的环境中可用,如 #{myBean.acao()}
显然没有抛出 EL 异常(EL 2.2 之前不支持此语法)。
<a href="#" jsf:action="#{myBean.acao(localObject)}">click me</a>
action
的调用通过 throw
AbortProcessingException
如果设置值无效,另见
Differences between action and actionListener ,然后声明一个
jsf:actionListener
.
<a href="#" jsf:actionListener="#{myBean.setObject(localObject)}" jsf:action="#{myBean.acao}">click me</a>
关于jsf - <f :setPropertyActionListener> Parent is not of type ActionSource, 类型是 : com. sun.faces.component.PassthroughElement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34275813/
我想在单击表格行时传递值: 我收到此错误: Parent is not of type ActionSource, type is: javax.faces.component.htm
从 primefaces 3.0.M3 升级到 3.0.M4-SNAPSHOT 时出现此错误 @60,114 Parent is not of type ActionSource, type is:
在我的复合组件中,我有一个 ui:repeat,除了其他静态内容外,还有一个命令按钮,如下所示: Aricle: #{article} 现在,我想在
我在我的 JSF 项目中使用 Passthrough 元素,需要做类似的事情: 但是使用 Passthrough 元素可以更好地控制我的前端,如下所示: click me
我是一名优秀的程序员,十分优秀!