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
Jsf composite:insertFacet和composite:renderFacet之间有什么区别?_Jsf_Jsf 2_Composite Component_Facet - Fatal编程技术网

Jsf composite:insertFacet和composite:renderFacet之间有什么区别?

Jsf composite:insertFacet和composite:renderFacet之间有什么区别?,jsf,jsf-2,composite-component,facet,Jsf,Jsf 2,Composite Component,Facet,我正在使用GlassFish 3.1.2,并试图在复合组件中使用composite:insertFacet,但在使用我的CC时不会生成HTML标记 当我使用composite:renderFacet时,同样的代码可以正常工作,但我想了解为什么composite:insertFacet在该示例中不起作用?什么时候使用它们 这是我的login.xhtml文件(复合组件实现,即“标题”方面): 使用RenderFace时,组件树: <UIOutput id="j_idt7" inView="tr

我正在使用GlassFish 3.1.2,并试图在复合组件中使用
composite:insertFacet
,但在使用我的CC时不会生成HTML标记

当我使用
composite:renderFacet
时,同样的代码可以正常工作,但我想了解为什么
composite:insertFacet
在该示例中不起作用?什么时候使用它们

这是我的
login.xhtml
文件(复合组件实现,即“标题”方面):

使用RenderFace时,组件树

<UIOutput id="j_idt7" inView="true" rendered="true" transient="false">

    <UINamingContainer id="j_idt8" inView="true" rendered="true" transient="false">
        error

        <HtmlMessages globalOnly="false" id="j_idt10" inView="true" layout="table" redisplay="true" rendered="true" showDetail="false" showSummary="true" styleClass="error" tooltip="false" transient="false"/>

        heading

        <div class="prompt">#{msgs.loginPrompt}</div>

        javax.faces.component.COMPOSITE_FACET_NAME

        <UIPanel inView="true" rendered="true" transient="false">

            <HtmlForm enctype="application/x-www-form-urlencoded" id="form" inView="true" onsubmit="return checkForm(this, '')" prependId="true" rendered="true" submitted="false" transient="false">

                <UIOutput id="j_idt15" inView="true" rendered="true" transient="false"/>

                <HtmlPanelGrid border="-2147483648" columns="2" id="j_idt16" inView="true" rendered="true" transient="false">
 ....

错误
标题
#{msgs.loginPrompt}
javax.faces.component.COMPOSITE_FACET_名称
....
不是为复合材料本身设计的,而是为复合材料的子项设计的,而子项又需要外部提供一个方面

例如,支持
(组合示例很差,但这只是为了说明问题):


它将被用作

<my:composite>
    <f:facet name="header">

这与在不使用复合材料的情况下执行以下操作的效果完全相同

<h:dataTable>
    <f:facet name="header">

确实很少使用

用于复合实现本身,基本上实现了与模板和标记文件中的
/
相同的功能

<UIOutput id="j_idt7" inView="true" rendered="true" transient="false">

    <UINamingContainer id="j_idt8" inView="true" rendered="true" transient="false">
        error

        <HtmlMessages globalOnly="false" id="j_idt10" inView="true" layout="table" redisplay="true" rendered="true" showDetail="false" showSummary="true" styleClass="error" tooltip="false" transient="false"/>

        heading

        <div class="prompt">#{msgs.loginPrompt}</div>

        javax.faces.component.COMPOSITE_FACET_NAME

        <UIPanel inView="true" rendered="true" transient="false">

            <HtmlForm enctype="application/x-www-form-urlencoded" id="form" inView="true" onsubmit="return checkForm(this, '')" prependId="true" rendered="true" submitted="false" transient="false">

                <UIOutput id="j_idt15" inView="true" rendered="true" transient="false"/>

                <HtmlPanelGrid border="-2147483648" columns="2" id="j_idt16" inView="true" rendered="true" transient="false">
 ....
<cc:implementation>
    <h:dataTable> 
        <cc:insertFacet name="header">
<my:composite>
    <f:facet name="header">
<h:dataTable>
    <f:facet name="header">