2017-01-24 1 views
-1

나는 primefaces 버전 6.0을 가지고 있는데,이 대화 상자가 나타나지 않습니다.primfaces 대화 상자가 단추를 클릭 할 때 표시되지 않습니다.

이것은 버튼입니다.

<p:commandButton id="newRequestButton" 
       class="btn btn-lg btn-primary" 
       value="New Request" 
       update=":newRequestForm:newRequestDialog" 
       oncomplete="PF('newRequest').show()" /> 

는 그리고 이것은 문제가 될 Whatcould 대화

<p:dialog header="Request Definitions" widgetVar="newRequest" 
        resizable="true" width="600" showEffect="explode" 
        hideEffect="explode" modal="true" height="300" 
        class="modal-dialog"> 
    <h:form id='newRequestForm'> 
     <h:panelGrid id="newRequestDialog" columns="1" cellpadding="4"   
        class="modal-content"> 

     </h:panelGrid> 
    </h:form> 
</p:dialog> 

입니다. 나는이 thisthis과 같은 몇 가지 대답을 따라왔다.

편집 : 정확히 dialogsforms하고이를 활성화하는 commandButtons에 대하여에 배치 될 예정입니까?

+0

로깅에서 무엇을 조사 했습니까? 브라우저 콘솔? 대화 내용을 업데이트 한 다음 대화 상자를 업데이트하는 대신 표시 했습니까? – Kukeltje

+0

@Kukeltje 대화 상자의 내용을 가지고있는'h : panelGrid'를 업데이트 중입니다. – Obby

+0

죄송합니다, 잘못 읽었습니다 : :-(Form은 모달이고 'appendTo 'body (PF 문서 참조) commandButton과 관련된 위치는 실제로 관련이 없습니다. commandButton이 전혀 작동하지 않아 서버 호출이 이루어지지 않으면이 기능이 작동하지 않아야하는 이유가 없습니다. – Kukeltje

답변

-1

문제는 내가 부트 스트랩 JQuery와 및 primefaces에 의해 제공되는 JQuery와 모두를 포함했다이었다. 부트 스트랩 jquery를 사용하지 않도록 설정했습니다.

+0

그러면 JS 콘솔에 오류가 발생했을 가능성이 큽니다 ... 다음에 [mcve]를 만드십시오 ... 이제는 문제를 일으킬만한 것이 없습니다. – Kukeltje

0

"form"과 같은 id 속성을 가진 h : form 태그에 commandButton과 dialog를 넣고 commandButton의 update 속성에 먼저 "form"(h의 id 속성 값 : button을 포함하는 form)을 써야합니다. 대화). 아래의 코드를 시도 :

<html xmlns="http://www.w3.org/1999/xhtml" 
     xmlns:h="http://java.sun.com/jsf/html" 
     xmlns:p="http://primefaces.org/ui" 
    <h:head> 
    </h:head> 
    <h:body> 
    <h:form id="form"> 

     <p:commandButton id="newRequestButton" 
       class="btn btn-lg btn-primary" 
       value="New Request" 
       update=":form:newRequestDialog" 
       oncomplete="PF('newRequest').show()" /> 

     <p:dialog header="Request Definitions" widgetVar="newRequest" 
        resizable="true" width="600" showEffect="explode" 
        hideEffect="explode" modal="true" height="300" 
        class="modal-dialog"> 

     <p:outputPanel id="newRequestDialog" style="text-align:center;"> 

     <p:panelGrid columns="1" class="modal-content"> 

     </p:panelGrid> 

     </p:outputPanel> 

     </p:dialog> 

     </h:form> 
</h:body> 
</html> 
+0

내 공동 de는 실제로 비슷하지만 양식은 중첩되지 않습니다. 그러나 이것은 여전히 ​​효과가 없습니다. 크롬 사용. 개발자 옵션을 켜고 콘솔에서 클릭 할 때 오류 메시지 나 메시지가 전혀 표시되지 않습니다. – Obby

+0

잘 위의 코드는 primefaces 5.0 – ArgaPK

+0

에서 잘 작동합니다. 위의 편집 된 코드를 시도합니다. 중첩 된 양식을 포함하지 않으며 대화 상자도 commandButton을 클릭하여 열 수 있습니다. – ArgaPK

관련 문제