2015-02-06 2 views
-1

Primeface를 사용하고 있습니다. 대화 상자 안에 dataTable이 있는데 정렬/필터링하려고하면 대화 상자가 닫힙니다. 아약스 호출이있을 때마다 대화 상자가 닫힙니다. 또한 "테스트"샘플 버튼을 만들려고 시도하고 대화 상자를 닫습니다. 이것을 방지 할 방법이 있습니까?아약스 전화로 대화 상자가 닫히는 경우

<p:outputPanel autoUpdate="true" deferredMode="true" deferred="visible"> 
    <p:dialog height="700px" width="100%" closable="true" closeOnEscape="true" header="Sample table" widgetVar="sampleDialog" modal="true" showEffect="fade" hideEffect="fade" resizable="false"> 
     <h:form> 
      <p:dataTable id="fooTableCurrent" 
          var="business" 
          value="#{mainViewController.lazyModel}" 
          paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}" 
          paginator="true" rows="20" style="width: 100%; text-align: center;" 
          rowsPerPageTemplate="10,20,50,100,200" 
          emptyMessage="No records found with given criteria" 
          editable="true" 
          lazy="true" 
          scrollable="true" 
          scrollHeight="100px"> 


       <p:ajax event="rowEdit" listener="#{mainViewController.onBusinessRowEdit}" /> 
       <p:ajax event="rowEditCancel" listener="#{mainViewController.onBusinessRowCancel}" /> 

       <p:column headerText="Employee reg. #"> 
        <h:outputText value="#{business.employee.employee_ID}" /> 
       </p:column> 

       <p:column headerText="Employee"> 
        <h:outputText value="#{business.employee.name}" /> 
       </p:column> 

       <p:column headerText="Bank"> 
        <h:outputText value="#{business.bank.name}" /> 
       </p:column> 

       <p:column headerText="Office" filterStyle="width:60px;" filterBy="#{business.office.office_ID}" filterMatchMode="contains"> 
        <h:outputText value="#{business.office.name}" /> 
       </p:column> 

       <p:column headerText="Product group" style="width: 100px;"> 
        <h:outputText value="#{business.product.product_group.name}" /> 
       </p:column> 

       <p:column headerText="Product" filterStyle="width:60px;" filterBy="#{business.product.product_ID}"> 
        <h:outputText value="#{business.product.name}" /> 
       </p:column> 

       <p:column headerText="Contract" filterStyle="width:60px;" filterBy="#{business.contract}"> 
        <h:outputText value="#{business.contract}" /> 
       </p:column> 

       <p:column headerText="Value" sortBy="#{business.value}"> 
        <p:cellEditor> 
         <f:facet name="output"><h:outputText value="#{business.value}" /></f:facet> 
         <f:facet name="input"><h:inputText value="#{business.value}" /></f:facet> 
        </p:cellEditor> 
       </p:column> 

       <p:column headerText="Date" sortBy="#{business.insert_date}"> 
        <h:outputText value="#{business.insert_date}" /> 
       </p:column> 

       <p:column headerText="Approved" width="55" style="text-align: center;"> 
        <p:selectBooleanCheckbox disabled="true" value="#{true}" /> 
       </p:column> 

       <p:column style="width:32px" headerText="Edit"> 
        <p:rowEditor /> 
       </p:column> 

       <p:column headerText="Delete" width="30"> 
        <p:commandButton icon="ui-icon-close" actionListener="#{mainViewController.deleteBusiness(business)}" update="@form"> 
         <p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-alert" /> 
        </p:commandButton> 

        <p:confirmDialog global="true" showEffect="fade" hideEffect="fade"> 
         <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" /> 
         <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" /> 
        </p:confirmDialog> 

       </p:column> 
      </p:dataTable> 
     </h:form> 
    </p:dialog> 
</p:outputPanel> 
+0

이 코드는 매우 시끄럽다. "직원"열을 제거하면 문제가 사라 집니까? 아니? 코드 스 니펫에서 생략하십시오. 'paginatorTemplate'을 제거하면 문제가 사라 집니까? 아니? 코드 스 니펫에서 생략하십시오. 'scrollable = "true"'를 제거하면 문제가 사라 집니까? 아니? 코드 스 니펫에서 생략하십시오. 조심스럽게 http://stackoverflow.com/help/mcve를 읽고 이에 맞게 질문을 수정하십시오. 그건 그렇고, 내 최고의 추측은 중첩 된 형태가 될 것입니다. – BalusC

답변

1

문제는 outputPanel 태그에 있습니다. 제거한 후 autoUpdate="true" 모든 것이 매력으로 작동했습니다.

+0

답해 주셔서 감사합니다. 나는 당신이 질문에 지금 이것을 추가했다는 것을 알았고, 다음 번에 [mcve] (http://stackoverflow.com/help/mcve)를 처음부터 만들어주십시오. – Kukeltje

0

oncomplete = 'PF.show('WIDGET_VAR_NAME)' 속성을 사용하면 대화 상자를 다시 표시 할 수 있습니다.

+0

이것은 다른 해결책이 원인을 수정 (제거)하는 동안 일종의 해결책 (보완)입니다. – Kukeltje

+0

제 경우에는'autoUpdate = "true"'없이 문제를 검색했습니다. 그것이 나를 위해 작동하기 때문에 나는 내 솔루션을 게시했습니다. –

+0

확인해 주셔서 감사 합니다만,'autoUpdate = "true"'(그리고 대화 상자 밖에서 명시 적으로 업데이트 된 내용이없는) 문제가있는 경우 사실 동일한 현상과 다른 '문제'가있었습니다 – Kukeltje

관련 문제