2017-05-16 12 views
-1

ajax呼び出しでダイアログボックスをポップアップしたいのですが、私は非常に多くの方法を試みましたが、解決策が見つかりませんでした。誰でも助けてくれてありがとう。p:ajaxの完了していない属性にダイアログが表示されない

XHTMLコードは、AJAXイベント=「変化」がラジオボタンの下盛ない

<h:body> 
    <h:form> 
     <p:selectOneRadio style="margin-left:10px" value="#{newSubBean.selectedEvent}" 
       required="true" layout="pageDirection"> 
      <f:selectItems value="#{newSubBean.events}" var="item" 
        itemValue="#{item.eventId}" itemLabel="#{item.title}" /> 
      <p:ajax event="change" update="dt" oncomplete="PF('sub').show()"> 
      </p:ajax> 
     </p:selectOneRadio> 

     <p:dialog visible="true" id="dialog" widgetVar="sub" 
       header="Previous Subscriptions" showEffect="explode" hideEffect="bounce"> 
      <p:dataTable id="dt" style="width:800px" 
        value="#{newSubBean.subscribedEventList}" var="rows"> 
       <f:facet name="header"> 
        <p:outputLabel value="Previous Subscriptions"> 
        </p:outputLabel> 
        <br/> 
        <p:outputLabel styleClass="preformatted" 
          value="#{newSubBean.eventName}"> 
        </p:outputLabel> 
       </f:facet> 
       <p:column headerText="Subscribed Notification"> 
        <p:outputLabel value="#{rows.notificationType.title}"> 
        </p:outputLabel> 
       </p:column> 
       <p:column headerText="Subscribed Template"> 
        <p:outputLabel value="#{rows.notificationTemplateDetail.title}"> 
        </p:outputLabel> 
       </p:column> 
       <p:column headerText="Subscription Time"> 
        <p:outputLabel 
          value="#{rows.insertionTimeStamp.getTime().toLocaleString()}"> 
        </p:outputLabel> 
       </p:column> 
      </p:dataTable> 
      <p:commandButton value="Close" onclick="PF('sub').hide();"> 
      </p:commandButton> 
     </p:dialog> 
    </h:form> 
</h:body> 
+0

フォームの外にダイアログを作ります。フォーム内にdataTableを挿入し、更新しようとするとdataTableフォームを更新します。 –

+1

@yagamiLight:なぜですか?私はこれを必要としません。 – Kukeltje

答えて

0

以下に示します。あなたが必要なもの

は、クリックイベントで、クリックイベントを使用すると、すべてのイベントを指定する必要はありませんラジオボタンのデフォルトのイベントですので:

<p:ajax update="dt" oncomplete="PF('sub').show()"/> 
+0

onChangeプロパティはpに利用できます:selectOneRadio、なぜ "onChange"イベントをサポートしないのですか? – Truthira

+1

http://stackoverflow.com/questions/21286545/pselectoneradio-not-updating-model-in-event-change-with-pajax http://stackoverflow.com/questions/13221089/primefaces-selectoneradio-ajax – lastresort

関連する問題