currentl, I try to implement a solution that will display a ConfirmDialog after the user has clicked on CLOSE DialogFramework button BUT before DialogFramework is closed.
That seems to work and I will post the complete solution when all will work correctly.
The problem that I have now is that after ConfirmDialog has been displayed and that user click on YES Button to close Confirm dialog and DialogFramework dialog, the form is correclty displayed but the ICON on which I have clicked to display the DialogFramework has stopped to work.
I can click on another icon just below and that works. But when I come back to the Form, the already clicked icons seem to be locked !
The Confirm dialog HTML code I use is :
Code: Select all
<p:dialog header="Continue without saving data" widgetVar="dlgConfirm" modal="true" height="100">
<p:panel>
<h:outputText value="Some fields has been modified and are NOT saved. Will you continue without saving them ?" />
</p:panel>
<p:commandButton
value="Yes"
type="button"
styleClass="ui-confirmdialog-yes"
icon="ui-icon-check"
onclick="PF('dlgConfirm').hide();HideDialogContext();"
/>
<p:commandButton
value="No"
type="button"
styleClass="ui-confirmdialog-no"
icon="ui-icon-close"
onclick="PF('dlgConfirm').hide();ShowDialogContext();"
/>
</p:dialog>
Code: Select all
<p:commandButton
class="show-text-editor"
icon="ui-icon-pencil"
onclick="showTextEditorWidget(this);"
/>
Code: Select all
function HideDialogContext()
{
var wgDialog = jQuery(".ui-dialog.ui-overlay-visible",window.parent.document)
.each
(function(nIndex)
{
var sWidgetName = $(this).attr('data-widgetvar');
var wgDialog = window.parent.PF(sWidgetName);
wgDialog.jq.hide();
wgDialog.disableModality();
});
}
The Javascript function for "showTextEditorWidget(this); is
Code: Select all
<p:column headerText="Modify" style="width:2ch;">
<p:commandButton
icon="ui-icon-pencil"
styleClass="rowButton"
ajax="true"
actionListener="#{oPostLabCtcController.onEditCtcRow(ctci)}"
>
<p:ajax
event="dialogReturn"
listener="#{oPostLabCtcController.updateTable()}"
update=":FormSession"
immediate="false"
/>
Using wgDialog.jq.hide(); and wgDialog.disableModality() is perhaps a bad idea because dialogReturn() event is not called !
How can I solve this last problem ?