Note that there are some explanatory texts on larger screens.

plurals
  1. POClient callback not getting called from primefaces dialog
    text
    copied!<p>I have a primefaces dialog which contains a Input text area and a command button "Submit".</p> <p>I have a form which contains a button "Reject" and the form is inside a Tabview. When the user clicks the button "Reject", I display the dialog "rejectDialog" for the user to enter the reason for rejection. Once the user enters the comments and clicks the Submit button "submitButton" in the dialog an action method is called in the bean to update the comments value. I have a oncomplete attribute that calls a javascript method. After the action method is completed, the javascript method is never executed and dialog box is closed. The action executes successfully and I do not get any error. I also tried replacing oncomplete with onsuccess, but still the javascript method is never executed. </p> <p>I would like to know why the javascript is never called in oncomplete inside a dialog?</p> <p>I also tried adding just an alert in the oncomplete attribute, but still the alert is never executed.</p> <p>The code is attached below.</p> <h2>XHTML Page</h2> <pre><code>&lt;p:dialog id="rejectDialog" header="Enter Comments" hideEffect="explode" showEffect="explode" resizable="false" widgetVar="rejectDlg" style="background: #bcbcbc !important;" &gt; &lt;h:panelGrid columns="1" cellpadding="0" cellspacing="2" styleClass="commentsPanel" id="dialogpanelgrid"&gt; &lt;p:outputLabel for="rejectComments" value="Enter Comments *: " style="font-weight: bold;"&gt; &lt;/p:outputLabel&gt; &lt;p:inputTextarea cols="40" rows="4" autoResize="false" id="rejectComments" styleClass="rejectCommentsCls" value="#{requestDetailsMB.rejectCommentsDesc}" style="background: lightgray !important; color:#000 !important;" widgetVar="txtreject" &gt; &lt;f:validator validatorId="commentsValidator"&gt;&lt;/f:validator&gt; &lt;/p:inputTextarea&gt; &lt;h:outputLabel id="rejectCommentsMessage" class="rejectCommentsMsg" value="" style="color:red !important; font-weight: bold;"&gt; &lt;/h:outputLabel&gt; &lt;/h:panelGrid&gt; &lt;p:commandButton id="submitButton" style="margin-top: 15px; float:right;" value="Submit" onclick="return validate();" action="#{requestDetailsMB.rejectRequest}" oncomplete="performRejectAction();" /&gt; &lt;/p:dialog&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload