2013-08-27 31 views
3

我有磷;自動完成標籤作爲低於該填充的聯繫人列表primefaces從對更新面板:自動完成

<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> 

在選擇應該ajaxically更新標籤下面視圖

<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> 

回答

1

您使用<p:outputPanel id="graphView">改爲<div id="graphView">

實際上,<p:outputPanel在客戶端呈現div標記。

+0

我改變了div來和我改變號碼:AJAX爲< p:ajax event =「itemSelect」update =「relationshipsForm,warningDialog,graphViewPanel」/>但仍然面板不刷新@RongNK – RanPaul

+0

@RanPaul您嘗試更改'rendered =「#{relationshipController.relationshipsName =='Contact'} 「'to'rendered =」true「'。 –

1

接觸將tabview的id添加到組件id的列表中,以更新autocompelte中的ajax。

+0

我改變了div爲,我改變了p:ajax作爲但是面板仍然是不刷新@djmj – RanPaul

+0

輸出面板也是'NamingContainer'' h:form'的子項嗎?如果不是,則需要使用完整的合格id路徑。您的問題不包含此信息。 – djmj

+0

是的輸出面板也是NamingContainer h:form的子元素,我將它改爲並且還使用了一個按鈕刷新面板,但其沒有得到刷新 – RanPaul

1

爲什麼在選擇一個值時更新自動完成本身?你應該更新其他內容,你希望顯示你的信息。 AsRongNK表示,使用p:outputPanel和id或者h:outputPanel來更新id。

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

+0

我改變了div爲,並且改變了p:ajax爲但是面板仍然不刷新@anm – RanPaul