Templates JSF找不到具有标识符、模板和cie的组件
编辑:另一个解决方案 首先,对不起我的英语,我是这些该死的单语言法语之一 我有一个典型错误:javax.faces.FacesException:找不到标识符为“formInscription:validerButton”的组件:formWaitingList” 我知道这是为什么,但我不知道如何解决它 我在页脚有一个连接表单。我想更新页面rankMe.xhtml中呈现的commandButton。此页面定义了模板.xhtml的ui:composition“content”。 当我使用commandbutton在页面上时,我没有错误,渲染工作非常完美。但是当我在另一个页面上,比如index.xhtml(它也定义了模板的内容.xhtml),Glassfish抛出了这个异常,我想这是完全标准的,因为其他内容(rankMe.xhtml)没有加载到实际视图中 我怎样才能避免这个例外?如果用户不在实际的rankMe.xhtml页面上,我可以在所有页面中复制我的commandbutton并将其隐藏,但这对我来说不是一种干净的方式 谢谢 代码如下: template.xhtml:Templates JSF找不到具有标识符、模板和cie的组件,templates,jsf,rendering,updates,identifier,Templates,Jsf,Rendering,Updates,Identifier,编辑:另一个解决方案 首先,对不起我的英语,我是这些该死的单语言法语之一 我有一个典型错误:javax.faces.FacesException:找不到标识符为“formInscription:validerButton”的组件:formWaitingList” 我知道这是为什么,但我不知道如何解决它 我在页脚有一个连接表单。我想更新页面rankMe.xhtml中呈现的commandButton。此页面定义了模板.xhtml的ui:composition“content”。 当我使用comman
<h:body>
<ui:insert name="content" >
</ui:insert>
<ui:insert name="footer" >
<ui:include src="../template/footer.xhtml"></ui:include>
</ui:insert>
</h:body>
<h:body>
<h:form id="formInscription">
<p:commandButton id="validerButton" update=":formWaitingList" ajax="true"/>
</h:form>
</h:body>
<h:body>
<ui:composition template="/template/template.xhtml">
<ui:define id="rankMe" name="content">
<h:form id="formWaitingList">
<h:commandButton id="Join"
rendered="#{connexion.connected}"
value="Join"/>
</h:form>
</ui:define>
</ui:composition>
</h:body>
footer.xhtml:
<h:body>
<ui:insert name="content" >
</ui:insert>
<ui:insert name="footer" >
<ui:include src="../template/footer.xhtml"></ui:include>
</ui:insert>
</h:body>
<h:body>
<h:form id="formInscription">
<p:commandButton id="validerButton" update=":formWaitingList" ajax="true"/>
</h:form>
</h:body>
<h:body>
<ui:composition template="/template/template.xhtml">
<ui:define id="rankMe" name="content">
<h:form id="formWaitingList">
<h:commandButton id="Join"
rendered="#{connexion.connected}"
value="Join"/>
</h:form>
</ui:define>
</ui:composition>
</h:body>
index.xhtml:
<h:body>
<ui:composition template="/template/template.xhtml">
<ui:define name="content">
Lorem ipsum ...
</ui:define>
</ui:composition>
</h:body>
乱数假文。。。
rankMe.xhtml:
<h:body>
<ui:insert name="content" >
</ui:insert>
<ui:insert name="footer" >
<ui:include src="../template/footer.xhtml"></ui:include>
</ui:insert>
</h:body>
<h:body>
<h:form id="formInscription">
<p:commandButton id="validerButton" update=":formWaitingList" ajax="true"/>
</h:form>
</h:body>
<h:body>
<ui:composition template="/template/template.xhtml">
<ui:define id="rankMe" name="content">
<h:form id="formWaitingList">
<h:commandButton id="Join"
rendered="#{connexion.connected}"
value="Join"/>
</h:form>
</ui:define>
</ui:composition>
</h:body>
想到两个非常简单的解决方案:
一种解决方案是将内容部分包装在
p:outputPanel
中,并更新它,而不是更新formWaitingList
:
<p:outputPanel id="globalPanel>
<ui:define name="content">
Lorem ipsum ...
</ui:define>
</p:outputPanel>
我想到了两个非常简单的解决方案:
一种解决方案是将内容部分包装在
p:outputPanel
中,并更新它,而不是更新formWaitingList
:
<p:outputPanel id="globalPanel>
<ui:define name="content">
Lorem ipsum ...
</ui:define>
</p:outputPanel>
谢谢你的提示,但它仍然有点混乱,我正在寻找一个真正的解决方案,除了它不存在。另外,如果你在这里添加一个输出面板,在我看来它不会改变任何东西,我猜你的意思是用outputPanel包装?也许我的解释失败了不,我的意思是,把
包装在输出面板中。那么第二个解决方案呢?我认为这是非常有用的第二个解决方案似乎是正确的,但似乎不是很严格。我想一些坚实的和适应性,遵循一个严格的模板与页脚内容和页眉,而不是一个混合的东西。当然它的。这里唯一不同的是,页脚是可定制的,它取决于使用过的视图听起来是一个不错的解决方案谢谢提示,但它仍然有点混乱,我正在寻找一个真正的解决方案,除了它不存在。另外,如果你在这里添加一个输出面板,在我看来它不会改变任何东西,我猜你的意思是用outputPanel包装?也许我的解释失败了不,我的意思是,把
包装在输出面板中。那么第二个解决方案呢?我认为这是非常有用的第二个解决方案似乎是正确的,但似乎不是很严格。我想一些坚实的和适应性,遵循一个严格的模板与页脚内容和页眉,而不是一个混合的东西。当然它的。唯一不同的是,页脚是可自定义的,它取决于使用的视图听起来是一个不错的解决方案似乎主题已经发布了:哦,似乎主题已经发布了: