Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Primefaces 传递不添加属性_Primefaces_Jsf 2 - Fatal编程技术网

Primefaces 传递不添加属性

Primefaces 传递不添加属性,primefaces,jsf-2,Primefaces,Jsf 2,我试图使用passthrough将title属性添加到f:selectItem组件,但它没有向我的DOM元素添加任何内容 环境 Server : Payara 5.184 JSF : 2.3.3.99 Framework : Primefaces 7.0 查看 <html ... xmlns:p="http://primefaces.org/ui" xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" ...> ... <p:sele

我试图使用passthrough
title
属性添加到
f:selectItem
组件,但它没有向我的DOM元素添加任何内容

环境

Server : Payara 5.184
JSF : 2.3.3.99
Framework : Primefaces 7.0
查看

<html ... xmlns:p="http://primefaces.org/ui" xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" ...>
...
<p:selectOneButton onchange="PF('myTable').filter()">
    <f:converter converterId="javax.faces.Boolean" />
    <f:selectItem itemLabel="a" itemValue="#{null}" pt:title="All" />
    <f:selectItem itemLabel="o" itemValue="#{true}" pt:title="OK" />
    <f:selectItem itemLabel="n" itemValue="#{false}" pt:title="NOTOK" />
</p:selectOneButton>

...
DOM

...
<div class="..." tabindex="0">
    <input ... type="radio" value="" class="ui-helper-hidden-accessible" tabindex="-1" checked="checked">
    <span class="ui-button-text ui-c">a</span>
</div>
...
。。。
A.
...

因此,没有添加
标题
属性有任何提示吗?

至少在PrimeFaces 8中,
f:selectItem
不支持passTour属性(因此此显式ANWR),但对于此特定用例,您有一个解决方案(使用
itemDescription
属性而不是
pt:title

源代码已打开。。。请检查是否试图通过其他选择组件处理passTour属性?尝试了PF 8?快速搜索结果,查看2019年9月17日的答案,这是否回答了您的问题?哦,好吧,我甚至没有试过这个,因为文档中说这个选项的描述是用于开发工具的。,谢谢@Kukeltje。正确。。。它不是官方“使用”的。正如你在巴卢斯的回答中所读到的那样,它(承认)是一种“虐待”;-)