Question
Pegasystems Inc.
US
Last activity: 3 Jul 2017 2:07 EDT
When rule to check if in Modal Dialog
I have a flow action that can run in Modal Dialog in one case, and in the main portal page (not Modal dialog) in other case.
I have a 'Cancel' button on the section for this flow action. The Cancel button has action 'close' that disposes off the modal dialog when clicked. However this button is effective only when the flow action runs in modal dialog.
I want to hide the 'cancel' button when the flow action does not run in modal dialog. What is the When rule or a property value that I can use to determine if the current flow action is running in modal dialog window or not?
Thanks
***Moderator Edit: Vidyaranjan | Updated Categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
Ok so what happens is that param will be only available during whole refresh since this is internal param. And you are only doing partial refresh by yourself, you will not have these params.
In your pre processing activity, for the first time when modal is opened, you can take backup of this param onto a property (transient ?) and then use that property for conditions. That way you will be sure with your logic.
Let me know if this helps :)
Pegasystems Inc.
IN
Hello yelas1,
Thanks for posting your query in PSC :)
In OOTB(out of the box), the Cancel button in the modal dialog is from the pzModalTemplate section. The cancel button in the flow action refers from the pyCaseActionAreaButton. I understand that you are looking to hide the cancel button while the section is loaded as FlowAction and it should be shown when the section is loaded in the modal dialog. Is my understanding correct? If yes, are you using OOTB modal dialog template pyModalTemplate or have customized it?
Can you try with below visibility condition on the Cancel button
param.pyShowFAButtons != true
Regards,
Rincy
Pegasystems Inc.
US
Hi Rincy, thanks for the suggestion. I am using the template 'ModalInteractionTransfer' with 'override default modal template' checked.
The visibility condition doesn't work :-(. The visibility condition is based on FlowAction, which runs here in both cases (in and not-in Modal dialog). There should be a property that would help determine if we are running in a Modal dialog window.
Pegasystems Inc.
US
the property is pega.u.d.bModalDialogOpen is set to true when the modal dialog is opened. Not sure whether you can use this in your when condition . Try and check ,whether this helps.
Pegasystems Inc.
US
Thanks Krithiga. The expression "pega.u.d.bModalDialogOpen == true' is always false whether the flow action run in a modal dialog or not
Pegasystems Inc.
US
The property is used extensively in JS check the "isModalLoaded" function in pega_ui_modal
Can you share the details of your construct your action set / When condition ? Screenshot ?
Can you try to "alert" the value in a JS and check if that is set correctly ?
Pegasystems Inc.
US
Screenshots attached. In the page source code I couldn't find the text 'isModalLoaded'
Pegasystems Inc.
US
Since that is a JS variable it is not available visible when "Expression". I will check if there are any other alternatives
Pegasystems Inc.
IN
You can use param.bIsModal. If this is true, flow action is opened in modal dialog mode.
Let us know if this helps or you need more information :)
-
Rodrigo Pinheiro Campos
Pegasystems Inc.
US
Thanks Pankaj.
param.bIsModal works partially. When flow action is not running in modal dialog, I don't see the Cancel button (good).
When running in Modal dialog, I see the Cancel button. However, when I make changes on the UI (radio button) and the UI is refreshed ('Disable submit on Refresh' is not checked), the Cancel button disappears. How to fix this?
Thanks,
-Sri
Accepted Solution
Pegasystems Inc.
IN
Ok so what happens is that param will be only available during whole refresh since this is internal param. And you are only doing partial refresh by yourself, you will not have these params.
In your pre processing activity, for the first time when modal is opened, you can take backup of this param onto a property (transient ?) and then use that property for conditions. That way you will be sure with your logic.
Let me know if this helps :)
-
Rodrigo Pinheiro Campos
Pegasystems Inc.
US
Awesome! I saved the parameter value in the pre-processing data transform into .pyTempTrueFalse and used this, it worked!!!
Many thanks Pankaj and to all for the suggestions.
-
Mohd Qizer