找不到“account”引用标识符“acinfo”的组件

时间:2012-09-12 13:50:23

标签: long-integer

<ui:define name="content">
    <h:panelGroup id="acinfo">
        <fieldset>
            <legend>#{masterdata['bank.account.info']}</legend>

            <table width="100%">
                <tr>
                    <td width="20%">#{masterdata['bank.account.name']}</td>
                    <td width="30%"><h:inputText
                            value="#{bankAccountBean.accountBank.name}" style="width:98%"
                            class="validate[required] text-input" tabindex="1" /></td>
                    <td width="20%">#{masterdata['bank.account.branch.name']}</td>
                    <td width="30%"><h:inputText
                            value="#{bankAccountBean.accountBank.namech}" style="width:98%"
                            class="validate[required] text-input" tabindex="6" /></td>
                </tr>
                ...............
            </table>
        </fieldset>
    </h:panelGroup>
    <fieldset>
        <legend> #{masterdata['bank.branch.list']} </legend>
        <p:dataTable id="account" value="#{bankAccountBean.listbankAccount}"
            var="baccount" selection="#{bankAccountBean.accountBank}"
            selectionMode="single" rowKey="#{baccount.makhtaikhoan}"
            scrollable="true" scrollWidth="1088" scrollHeight="250"
            style="text-align: left;">
            <p:ajax event="rowSelect" update="acinfo" />
            <p:column headerText="#{masterdata['bank.branch.name']}">
                <h:outputText value="#{baccount.name}" />
            </p:column>
            <p:column headerText="#{masterdata['bank.account.branch.name']}">
                <h:outputText value="#{baccount.namech}" />
            </p:column>
            <p:column headerText="#{masterdata['bank.account.code']}">
                <h:outputText value="#{baccount.makhtaikhoan}" />
            </p:column>
            <p:column headerText="#{masterdata['bank.account.number']}">
                <h:outputText value="#{baccount.mataikhoan}" />
            </p:column>
        ...........

        </p:dataTable>
    </fieldset>
</ui:define>

主模板

<h:form id="formbutton" prependId="false">

    <div id="cont" class="contentform" style="padding-top: 16px;">
        <div style="text-align: left; height: 18px; margin-top: 10px;">
            <p:messages id="messages" autoUpdate="true" />

        </div>
        <div>
            <ui:insert name="content">Content Form</ui:insert>


        </div>
    </div>
    <div id="jSplash"></div>
</h:form>

错误

[javax.enterprise.resource.webcontainer.jsf.application] (http-localhost-127.0.0.1-8080-6) Error Rendering View[/masterdata/CM_Bank_Account.xhtml]: javax.faces.FacesException: Cannot find component with identifier "acinfo" referenced from "account".

1 个答案:

答案 0 :(得分:1)

首先,尝试在它前面添加冒号,使其变为update=":acinfo",看看是否有效。

如果没有,那么如果你把更新拿出来(所以页面加载)并在页面上找到acinfo panelGroup,它的ID是否仍然是acinfo?我看到你的主模板中prependId设置为false,但仔细检查可能是明智之举。如果它不同,请尝试将其设置为相反(或在其前面使用冒号。)

如果这两个都失败了,也许尝试将formbutton上的prependId设为true,然后update=":formbutton:acinfo"