【发布时间】:2021-07-27 12:16:34
【问题描述】:
我有以下 Facelet Taglib:
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:o="http://omnifaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html">
<o:tagAttribute name="id"/>
<h:panelGroup id="#{id}" layout="block" styleClass="idTest">
#{id}
</h:panelGroup>
</ui:composition>
taglib.xml 如下所示:
<tag>
<tag-name>idTest</tag-name>
<source>resources/myProject/tags/idTest.xhtml</source>
</tag>
而且使用它的代码很简单:
<myProject:idTest/>
怎么可能会呈现以下 HTML:
<div class="idTest">
j_ido489794984_4bf870cd
</div>
为什么我的PanelGroup 没有id? id 是根据 o:tagAttribute 的文档生成的,因为 div 的内容已被渲染。但是作为id 它不起作用。为什么?
【问题讨论】: