Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2600

DesktopCleanup should works when Using Clients.confirmClose()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.5
    • 7.0.4
    • None
    • None

      If we remove Clients.confirmClose("Make sure"), it will work.
      Right behavior is using Clients.confirmClose shouldn't affect DesktopCleanup.

      // composer

      Bar.java
      
      import org.zkoss.zk.ui.Executions;
      import org.zkoss.zk.ui.select.SelectorComposer;
      import org.zkoss.zk.ui.util.Clients;
      import org.zkoss.zk.ui.util.DesktopCleanup;
      import org.zkoss.zul.Window;
      
      public class Composer849 extends SelectorComposer<Window> {
      
      	private static final long serialVersionUID = -7360829196117880724L;
      
      	@Override
      	public void doAfterCompose(Window comp) throws Exception {
      		Clients.confirmClose("Make sure");
      		
      		Executions.getCurrent().getDesktop().addListener(new DesktopCleanup(){
      			
      			@Override
      			public void cleanup(org.zkoss.zk.ui.Desktop desktop)
      					throws Exception {
      				System.out.println("test...");
      				
      			}
      		});
      		super.doAfterCompose(comp);
      	}
      }
      

      // zul

       
      <zk>
      
      	<zk>
      		<window border="normal" title="hello" apply="Composer849">
      
      			<div>Welcome to ZK Fiddle , run it right now!</div>
      
      		</window>
      		<script>
      
      		</script>
      	</zk>
      </zk>
      

            Unassigned Unassigned
            JerryChen JerryChen
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: