Java 来自p:autoComplete的primefaces更新面板

Java 来自p:autoComplete的primefaces更新面板,java,ajax,jsf,primefaces,Java,Ajax,Jsf,Primefaces,我有p;自动完成标记,如下所示,用于填充联系人列表 <h:form id="relationshipsForm"> //code <p:autoComplete id="contactAutoComplete" rendered="#{relationshipController.relationshipsName=='Contact'}" v

我有p;自动完成标记,如下所示,用于填充联系人列表

<h:form id="relationshipsForm">
//code
    <p:autoComplete id="contactAutoComplete"
                                rendered="#{relationshipController.relationshipsName=='Contact'}"
                                value="#{relationshipController.contactKeyWord}"
                                completeMethod="#{contactRelationshipController.completeContacts}"
                                var="contact" itemLabel="#{contact.fullName}"
                                itemValue="#{contact}" converter="#{contactConverter}"
                                forceSelection="true" size="35" scrollHeight="200"
                                panelStyle="width:10px;">
                                <p:ajax event="itemSelect" update="relationshipsForm,graphViewPanel" />
                            </p:autoComplete> 

//代码
选择联系人时,应轴向更新下面的选项卡视图

<p:outputPanel id="graphViewPanel">
                <h:inputHidden id="orgViewUnMappedJSonDataList"
                    value="${relationshipController.getOrgViewUnMappedJSonData()}" />
                <h:inputHidden id="orgViewMappedJSonDataList"
                    value="${relationshipController.getOrgViewMappedJSonData()}" />

    <p:tabView scrollable="true" id="tabView" dynamic="true" cache="true">
                    <p:tab id="orgViewTab" title="Org View">
                        <h:outputScript library="js" name="go.js" />
                        <h:outputScript library="js" name="gojs_org_view.js" />
                        <h:outputStylesheet library="css" name="gojs_org_view.css" />
                    </p:tab>
                </p:tabView>
    </p:outputPanel>
</h:form>

将选项卡视图的id添加到组件id列表中,以更新自动编译中的ajax。

您可以使用
更改


事实上,
为什么要在选择值时更新自动完成本身?您应该更新希望显示信息的其他内容。Asronnk说,使用带有id的p:outputPanel或带有id的h:outputPanel进行更新


您可以引用p:ajax中的id。

我将div更改为,将p:ajax更改为,但面板仍不刷新@anmI将div更改为,将p:ajax更改为,但面板仍不刷新@RongNK@RanPaul您尝试更改
rendered=“#{relationshipController.relationshipsName=='Contact'}”
改为
rendered=“true”
。我将div改为,并将p:ajax改为,但面板仍然没有刷新@djmj输出面板也是
NamingContainer
h:form
的子级吗?如果没有,则需要使用完整的限定id路径。您的问题不包含此信息。是的,outputpanel也是NamingContainer h:form的子级,我将其更改为,并且正在使用按钮刷新面板,但它没有得到刷新