private void createPrintContactsSubForm ( ) { add ( new WHeading ( HeadingLevel . H3 , "Print to CSV" ) ) ; WButton printBtn = new WButton ( "Print" ) ; printBtn . setAction ( new Action ( ) { @ Override public void execute ( final ActionEvent event ) { printDetails ( ) ; } } ) ; printBtn . setImage ( "/image/document-print.png" ) ; printBtn . setImagePosition ( WButton . ImagePosition . EAST ) ; WFieldLayout layout = new WFieldLayout ( ) ; add ( layout ) ; layout . setMargin ( new Margin ( Size . LARGE , null , null , null ) ) ; layout . addField ( "Print output" , printOutput ) ; layout . addField ( ( WLabel ) null , printBtn ) ; add ( new WAjaxControl ( printBtn , printOutput ) ) ; }
Create the UI artefacts for the Print contacts sub form .