This ticket fixes errors that occur when closing a dialog. It also introduces changes to the API of the DefaultDialogModel class, which is used to create dialogs. An argument can now be specified as to whether the dialog should be closable or not. In this context, closeable means the functionality that the close X button or clicking in the background of the dialog closes the dialog.
Test
Perform the tests listed below in the application.
Test 1
- Click on Create element.
- Make a change.
- Click in the dialog background.
- Select "Discard"
- Error: Operation crashes:
{{{
com.top_logic.util.error.TopLogicException: Internal error at com.top_logic.mig.html.layout.CommandDispatcher.internalDispatchCommand(CommandDispatcher.java:218) at com.top_logic.mig.html.layout.CommandDispatcher.internalDispatch(CommandDispatcher.java:134) at com.top_logic.mig.html.layout.CommandDispatcher.dispatchCommand(CommandDispatcher.java:127) at com.top_logic.layout.basic.CommandHandlerCommand.executeCommand(CommandHandlerCommand.java:51) at com.top_logic.layout.basic.DirtyHandling$DirtyHandlingAction.continueExecution(DirtyHandling.java:560) at com.top_logic.layout.basic.DirtyHandling$DiscardChanges.executeCommand(DirtyHandling.java:404) at com.top_logic.layout.form.model.ExecutableCommandField.executeCommand(ExecutableCommandField.java:76) at com.top_logic.layout.basic.ActivateCommand.execute(ActivateCommand.java:94) at com.top_logic.layout.basic.AbstractControlBase.executeCommand(AbstractControlBase.java:981) at com.top_logic.layout.basic.component.ControlSupport.executeCommand(ControlSupport.java:223) at com.top_logic.layout.basic.component.ControlComponent$DispatchAction.handleCommand(ControlComponent.java:233) at com.top_logic.tool.boundsec.CommandHandlerUtil.handleCommand(CommandHandlerUtil.java:31) at com.top_logic.mig.html.layout.LayoutComponent.dispatchCommand(LayoutComponent.java:3076) at com.top_logic.mig.html.layout.CommandDispatcher.internalDispatchCommand(CommandDispatcher.java:196) at com.top_logic.mig.html.layout.CommandDispatcher.internalDispatch(CommandDispatcher.java:134) at com.top_logic.mig.html.layout.CommandDispatcher.dispatchCommand(CommandDispatcher.java:127) at com.top_logic.base.services.simpleajax.AJAXServlet.processRequest(AJAXServlet.java:686) at com.top_logic.base.services.simpleajax.AJAXServlet.doPost(AJAXServlet.java:359)
Caused by: java.lang.ClassCastException: class com.top_logic.tool.boundsec.BoundLayout cannot be cast to class com.top_logic.layout.form.component.FormComponent (com.top_logic.tool.boundsec.BoundLayout and com.top_logic.layout.form.component.FormComponent are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @4e8598d9) at com.top_logic.layout.form.component.AbstractCreateComponent$CancelHandler.handleCommand(AbstractCreateComponent.java:387) at com.top_logic.tool.boundsec.CommandHandlerUtil.handleCommand(CommandHandlerUtil.java:31) at com.top_logic.mig.html.layout.LayoutComponent.dispatchCommand(LayoutComponent.java:3076) at com.top_logic.mig.html.layout.CommandDispatcher.internalDispatchCommand(CommandDispatcher.java:196) ... 54 more }}}
Test 2
- Click on Create element.
- Make the change.
- Click the "Cancel" button.
- Error: The prompt "You have made changes" appears again.
Test 3
- Create attribute in the model editor.
- Make changes in the dialog.
- Click in the background.
- Error: Dialog closes without prompting.
Test 4
- Navigate to this page: Technical Demo > Layout-Framework#1 > Forms > Form Controls (inline)
- Press the various progressComand buttons to open the Progress dialog.
- Test that it cannot be closed unless you press the Cancel button.