简体   繁体   English

在JSF中,什么可以用作逻辑NamingContainer?

[英]What might serve as a logical NamingContainer in JSF?

Assume I have 假设我有

<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:p="http://primefaces.org/ui" 
    xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    <div>
        <p:accordionPanel id="accordionPanel" multiple="false" >
            <div >
                <p:tab title="aTab">
                    <!--logical naming container tag open-->
                    <h:form>
                        <h:inputText id="inputText" value="#{backingBean.property}">
                            <f:ajax event="change" listener="#{backingBean.onChange}" render="@form ..:autoCompleteForm:autoComplete"/>
                        </h:inputText>
                    </h:form>
                    <h:form id="autoCompleteForm">
                        <p:autoComplete id="autoComplete" value="#{backingBean.property2}" disabled="#{backingBean.disabled}"/>
                    </h:form>
                    <!--logical naming container tag close-->
                </p:tab>
            </div>
        </p:accordionPanel>
    </div>
</ui:composition>

and I want to reference autoComplete relatively from the first form. 我想从第一种形式中相对引用autoComplete According to http://illegalargumentexception.blogspot.de/2009/02/jsf-working-with-component-ids.html a relative id specification is resolved relative to the closest naming container and to the closest naming container of the closest naming container if ..: is specified. 根据http://illegalargumentexception.blogspot.de/2009/02/jsf-working-with-component-ids.html ,相对ID规范是相对于最近的命名容器以及最近的命名容器的最近命名容器进行解析的如果指定..: According to http://www.primefaces.org/docs/api/5.0/ Tab isn't a NamingContainer (neither is AccordionPanel ) which brings me in need of a logical naming container element which I imagine to put where the comments are in order to reduce complexity to a minimum for relative references. http://www.primefaces.org/docs/api/5.0/ Tab不是NamingContainer (既不是AccordionPanel ),这使我需要我想象放到哪里的意见是在逻辑命名容器元素为了将相关参考的复杂性降至最低。 What would such a logical naming container be (I assmue that nested forms are not allowed ( Nested forms in JSF ))? 这样的逻辑命名容器是什么(我假设不允许使用嵌套形式(JSF中的嵌套形式 ))?

That's the <f:subview> . 那就是<f:subview>

See also: 也可以看看:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM