Close modal dialog after button click
Hi.
We have to create an autosave form with a custom "OK" and "Cancel" button (Hide the header and the footer of the Rule dialog box). There are several reasons why we have to do it this way. :(
Is there a functionality how we can close the modal dialog after we've clicked one of the mentioned buttons??
My idea was to use "After the action is performed, redirect the user to a specific location" and there use "Go to URL". Sadly I'm not able to call more than one Javascript function.
If I use the following statements in the JS-console of the browser it seems everything is workling fine:
- document.getElementsByClassName("dialog-rul_ECMIPM_Eingang_AendernEingangsattribute")[0].remove();
- document.querySelectorAll("ux-dialog-container")[0].remove();
- document.querySelectorAll("ux-dialog-overlay")[0].remove();
KR Alex
Comments
-
Hello Alex,
simply closing the dialog is not enough: you also need to send an event to the caller with the result.
Instead of the above hacks you should see to get a solution that works with the standard. Please explain, why the standard footer of the dialog box should be removed?
regards - Helmut
0 -
Hi @Alexander Jakob,
I agree with Helmut. Keep things simple!
These steps easily solve your problem:
- Create a "Cancellable" type of form (that has a "Cancel" instead of a "Close")
- Create an "Action" type of Rule BB
- Set the condition to TRUE (or whatever you want)
- Check "Before the action is performed, launch a modal dialog"
- Use "Open a form" and select your cancellable form
- Select "- Save changes without performing other actions -"
- Create a 'Theme' type of document
- @import a "your_brand.css" file (exposed via a WLD); See here
- The CSS can hide the header (at least for 24.2)…I don't see any footer, but will be the same trick.
ai-dialog-header.au-target { min-height: 0px; } .ai-dialog-header-container { display: none; }
//Antal
0 -
If you are using AppWorks 23.3+, a new set of public APIs are now available to complete or close the rule dialog boxes with custom forms, which enables the application developer to integrate with external systems. These APIs help to show their custom actions in rule dialog boxes and perform rule actions by using client APIs from custom application code.
In the rule design, you can configure to hide the header and footer and also control the size of your model dialog.
In the runtime, you can use the client public API's to trigger the action and close the dialogue from your custom html page.
let parentDomain = window.location.href.split('baseDomain=')[1] let okAction = {} okAction.name = 'submitActionWithMessage' --> Predefined message name okAction.submitType = 'okAction'--> Predefined submit type for Ok action okAction.submitMessage = 'Custom action performed'--> Custom message to be displayed after performing.
For more details on API refer the topic, 'Using the application JavaScript APIs' from AppWorks Platform → Advance development help guide.
0 -
@nssmani That's a great tip on the header/footer and custom size of a dialog….I wasn't aware of the option. Thx //Antal
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 150 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories