标签: passthrough-elements

<f:setPropertyActionListener>父级不是ActionSource类型,类型是:com.sun.faces.component.PassthroughElement

我在JSF项目中使用Passthrough元素,并且需要执行以下操作:

<h:commandLink action="#{myBean.acao()}" value="click me">
        <f:setPropertyActionListener target="#{myBean.object}" value="#{localObject}"/>
</h:commandLink>
Run Code Online (Sandbox Code Playgroud)

但是使用Passthrough元素可以更好地控制前端,例如尝试以下操作:

<a href="#" jsf:action="#{myBean.acao()}">click me
        <f:setPropertyActionListener target="#{myBean.object}" value="#{localObject}"/>
</a>
Run Code Online (Sandbox Code Playgroud)

但显然这不起作用,我收到以下错误消息:

<f:setPropertyActionListener> Parent is not of type ActionSource, type is: com.sun.faces.component.PassthroughElement
Run Code Online (Sandbox Code Playgroud)

有谁知道我该怎么解决?

jsf jsf-2.2 passthrough-elements setpropertyactionlistener

5
推荐指数
1
解决办法
1247
查看次数

<a jsf:rendered="#{...}">不会被解释为passthrough元素

我不明白为什么这段代码工作正常:

<h:link value="Login" rendered="#{sessionBean.userInSessionBean == null}"  />
Run Code Online (Sandbox Code Playgroud)

而这段代码不起作用:

<a jsf:rendered="#{sessionBean.userInSessionBean == null}">Login</a>
Run Code Online (Sandbox Code Playgroud)

jsf rendered-attribute jsf-2.2 passthrough-elements

4
推荐指数
1
解决办法
337
查看次数

HTML5 Pass-Through元素导致Eclipse警告'Unknown tag'

我的JSF template.xhtml文件看起来像:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:jsf="http://xmlns.jcp.org/jsf">

<h:head>
    ...
</h:head> 
<h:body>
    <header jsf:id="head">
        ...
    </header>
    <nav jsf:id="nav">
        ...
    </nav>
    <main jsf:id="main">
        ...
    </main>
    <footer jsf:id="foot">
        ...
    </footer>
</h:body>
</html>
Run Code Online (Sandbox Code Playgroud)

Eclipse抱怨说

未知标签(主要).

我想知道我的文件是否以某种方式格式错误,或者Eclipse无法正确验证这一点.

eclipse jsf html5 program-entry-point passthrough-elements

2
推荐指数
1
解决办法
2071
查看次数