2013-06-27 24 views
0

我有這樣一個代碼:更新的<h:panelGroup中>從另一個的<h:panelGroup中>不工作

<h:panelGroup id="customListCal"> 
.. 
     <p:commandButton value="Create List" update="pickList" actionListener="#{customCalender.openList}" 
         style="background:#25A6E1;color:#fff;font-family:'Helvetica Neue',sans-serif;font-size:10px;border-radius:4px;"/> 
</h:panelGroup> 

<h:panelGroup id="pickList"> 
.. 
    <p:commandButton value="Cancel" update="pickList" actionListener="#{customCalender.closeList}" style="background:#25A6E1;color:red;font-family:'Helvetica Neue',sans-serif;font-size:10px;border-radius:4px;" /> 
    <p:commandButton value="Save" update="custDataTablePanel pickList" actionListener="#{customCalender.saveTargetList}" style="background:#25A6E1;color:red;font-family:'Helvetica Neue',sans-serif;font-size:10px;border-radius:4px;"/> 
</h:panelGroup> 

<h:panelGroup id="custDataTablePanel"> 
    <p:panel rendered="#{customCalender.dataTableVisible}"> 
     <p:dataTable id="custDataTable" value="#{customCalender.dataTableList}" var="listName"> 
       <p:column id="editField" headerText="Edit"> 
          <p:commandLink title="Edit" update="pickList" actionListener="#{customCalender.openList}" rendered="#{not empty customCalender.dataTableList}"> 
           <h:graphicImage url="resources/images/edit.JPG"/> 
          </p:commandLink> 
       </p:column> 
     </p:dataTable> 
    </p:panel> 
</h:panelGroup> 

當我嘗試更新從<h:panelGroup id="custDataTablePanel><h:panelGroup id="pickList">其不工作。會發生什麼,只是這個名爲Edit的色彩不在上述dataTable中呈現。

如何從<h:panelGroup id="custDataTable">更新<h:panelGroup id="pickList">

但在更新從<h:panelGroup id="customListCal">

<h:panelGroup id="customListCal"> 
.. 
     <p:commandButton value="Create List" update="pickList" actionListener="#{customCalender.openList}" 
         style="background:#25A6E1;color:#fff;font-family:'Helvetica Neue',sans-serif;font-size:10px;border-radius:4px;"/> 
</h:panelGroup> 

<h:panelGroup id="pickList">沒有錯誤,這是怎麼造成的,我該如何解決呢?

+0

確保了'號碼:commandButton'是一個字中,h內:form' – Daniel

+0

@Daniel:在''標籤內的.. :( – NDeveloper

+0

是' picklist'和'custDataTable'在同一個表單中? – fareed

回答

0

這是在3.4版之前的Primefaces中的一個已知問題。但既然你有一個3.4,那麼我唯一的建議是使用核心JSF按鈕而不是primefaces按鈕。而不是

<h:commandButton> 
    <f:ajax render="element"> <!--or render=":form1:element"--> 
</h:commandButton> 

<p:commandButton update ="element"> 
+0

但是它是一個''我在這裏使用'' – NDeveloper

+0

您可以使用具有相同功能的'' – fareed

+0

@NGH是否嘗試過? – fareed

相關問題