Trinidad 2.2.1 的数据表 detailstamp 在自定义提示方面时解析为 null

Trinidad 2.2.1's datatable detailstamp resolves to null when customizing the prompt facet

我们正在从 JSF 1.2 升级到 2.2,我们在升级特立尼达时遇到了障碍。

在 Trinidad 2.2.1 中,当您自定义提示方面时,数据表的详细信息戳将解析为空。还有人知道为什么会这样吗?

这是在 Wildfly (10.1.0.Final) 上用 Mojarra 2.2.13.SP1、Java 8 (1.8.0_131)、JSF 2.2 和 Trinidad 2.2.1 测试的(问题也存在于 2.2)。

Java:

@Named
@RequestScoped
public class ProductBean {

    private final AtomicBoolean seeded = new AtomicBoolean(false);
    private final List<Product> products = Collections.synchronizedList(new ArrayList<>());

    @PostConstruct
    public void init() {
        if (!seeded.get()) {
            products.add(new Product(1, new ProductInfo("product 1", "1")));
            products.add(new Product(2, new ProductInfo("product 2", "2")));
            products.add(new Product(3, null));

            seeded.set(true);
        }
    }

    public List<Product> getProducts() {
        return products;
    }

    public static class Product {
        private final int id;
        private final ProductInfo info;

        public Product(int id, ProductInfo info) {
            this.id = id;
            this.info = info;
        }

        public int getId() {
            return id;
        }

        public ProductInfo getInfo() {
            return info;
        }
    }

    public static class ProductInfo {
        private final String name;
        private final String code;

        public ProductInfo(String name, String code) {
            this.name = name;
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public String getCode() {
            return code;
        }
    }
}

xhtml:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tr:document xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:trh="http://myfaces.apache.org/trinidad/html"
    xmlns:tr="http://myfaces.apache.org/trinidad"
    xmlns:ui="http://java.sun.com/jsf/facelets">

    <tr:page>
        <tr:form id="mainForm">
            <tr:table id="products" value="#{productBean.products}"
                var="product">
                <tr:column headerText="Id">
                    <tr:outputText value="#{product.id}"></tr:outputText>
                </tr:column>
                <tr:column headerText="Naam">
                                    #{product.info.name}
                                </tr:column>
                <f:facet name="detailStamp">
                    <f:facet name="prompt">
                        <tr:outputText value="Details" />
                    </f:facet>
                        #{product.id} | #{product.info.name}
                    </f:facet>
            </tr:table>
        </tr:form>
    </tr:page>
</tr:document>

我是个白痴。特立尼达工作正常。 prompt facet 应该在 detailStamp facet 之外。

<f:facet name="detailStamp">
    #{product.id} | #{product.info.name}
</f:facet>
<f:facet name="prompt">
    <tr:outputText value="Details" />
</f:facet>