合成未在Richfaces选项卡中呈现 [英] Composition is not rendered in Richfaces tabPanel
问题描述
我是JSF和Richfaces的用户.我将简化有关我的问题的代码,以使事情变得更容易. 我有一个名为"mytab.xhtml"的组成,定义如下:
I am a user of JSF and Richfaces. I will simplify the code about my question to make things easier. I have a composition named 'mytab.xhtml' defined like following:
<cc:interface>
<cc:attribute name="header" required="true"/>
</cc:interface>
<cc:implementation>
<rich:tab id="my-tab" header="#{cc.attrs.header}" >
<cc:insertChildren />
</rich:tab>
</cc:implementation>
此构成用于另一个xhtml文件,如下所示:
This composition is used in another xhtml file like following:
<rich:tabPanel id="tp" switchType="ajax" headerPosition="top" >
<ic:mytab id="tab1" header="header1">
<h:outputText>content1</h:outputText>
</ic:mytab>
<ic:mytab id="tab2" header="header2">
<h:outputText>content1</h:outputText>
</ic:mytab>
</rich:tabPanel>
但是完全不呈现选项卡是非常奇怪的. 为了找到原因,如果我在合成定义文件中添加如下所示的outputText:
But it is very strange that the tab is not rendered at all. To find the reason, if I add an outputText in the composition definition file like this:
<cc:interface>
<cc:attribute name="header" required="true"/>
</cc:interface>
<cc:implementation>
<h:outputText>#{cc.attrs.header}</h:outputText>
<rich:tab id="my-tab" header="#{cc.attrs.header}" >
<cc:insertChildren />
</rich:tab>
</cc:implementation>
outputText将被呈现,但制表符不被呈现.
The outputText will be rendered, but tab is not rendered.
或者,如果我将其中一个标签直接更改为richfaces标签:
Or, if I change one of the tab to richfaces tab directly:
<rich:tabPanel id="tp" switchType="ajax" headerPosition="top" >
<ic:mytab id="tab1" header="header1">
<h:outputText>content1</h:outputText>
</ic:mytab>
<rich:tab id="tab2" header="header2">
<h:outputText>content1</h:outputText>
</rich:tab>
</rich:tabPanel>
第一个选项卡将不会呈现,但第二个选项卡将呈现.
The first tab will not be rendered, but the second tab will be rendered.
谢谢您能给我任何帮助.
Thank you if you could give me any help.
推荐答案
复合组件呈现为自己的UINamingContainer
.因此,在UITabPanel
和UITab
组件之间现在是一个UINamingContainer,UITab
可能不知道该如何处理(顺便说一下,数据表存在相同的问题).您可以使用经典facelet标签.
Composite components are rendered as own UINamingContainer
. So between the UITabPanel
and the UITab
-component now is a UINamingContainer, UITab
might not know what to do with it (same problem with datatable, by the way). What you can do is to use a classic facelet tag instead.
这篇关于合成未在Richfaces选项卡中呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!