-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to close a custom dialog? #286
Comments
Hi @relizondobarrios, currently it is not possible to close the dialog without providing a command in the DialogData object. I'm marking this as a feature request and logging it in our backlog. Can you share the reason why you need to create a custom button and not use the commands property in the DialogData? |
Hi @Novkirishki This is the dialogue we implement: thank you for answering |
Hi @relizondobarrios, In order to render the Cancel and Done buttons you can pass the following command models to the DialogData object when opening the dialog: Upon pressing the Done button the MyDoneCommand would be executed. As long as its execute method is returning false values the dialog won't be closed. As soon as the update process is complete, you can next() true value and the dialog will close. Here is an example with setTimeout() simulating the process: Hope this will help you! |
Hi @Novkirishki Thank you for your support. I applied the suggested sample in my code and went through a scenario. I have an OData service to add new products to the Products content type. This service must validate the product number and based on some restrictions we decide whether or not to add the product. If the product number is invalid, I display a notification with the error message, but I want to keep the dialog open because the user might want to try again. I assumed that if you used result.next(false); the dialog will stay open and the buttons will be reset, but it didn't work as expected because the dialog closed even though I used result.next(false); or result.next(true); The thing is, I don't know how to reset the "cancel" and "done" commands. Is this supported? |
We are creating a custom dialog where the user can select some items and then click the "Apply" button (This button is totally created by us / HTML and function (click)). When the user clicks this button, we are implementing a process. When this process is finished, we should close the dialog automatically.
This is the implementation of the custom dialog
Same as SELECTOR_SERVICE.openDialog(dialogData), is there a .closeDialog() method? How can we close the dialog?
The text was updated successfully, but these errors were encountered: