public static Window show ( String dialog , Map < String , Object > args , boolean closable , boolean sizable , boolean show , IEventListener closeListener ) { Window parent = new Window ( ) ; // Temporary parent in case materialize fails, so can cleanup. Page currentPage = ExecutionContext . getPage ( ) ; parent . setParent ( currentPage ) ; Window window = null ; try { PageUtil . createPage ( dialog , parent , args ) ; window = parent . getChild ( Window . class ) ; if ( window != null ) { // If any top component is a window, discard temp parent window . setParent ( null ) ; BaseComponent child ; while ( ( child = parent . getFirstChild ( ) ) != null ) { child . setParent ( window ) ; } parent . destroy ( ) ; window . setParent ( currentPage ) ; } else { // Otherwise, use the temp parent as the window window = parent ; } window . setClosable ( closable ) ; window . setSizable ( sizable ) ; if ( show ) { window . modal ( closeListener ) ; } } catch ( Exception e ) { if ( window != null ) { window . destroy ( ) ; window = null ; } if ( parent != null ) { parent . destroy ( ) ; } DialogUtil . showError ( e ) ; log . error ( "Error materializing page" , e ) ; } return window ; }
Can be used to popup any page definition as a modal dialog .