ZK

From iDempiere en
(Redirected from Code Scratchpad: Java: ZK)


Show window from process

Method 1: Runnable

Runnable runnable = new Runnable() {
			
			@Override
			public void run() {
				MPrintFormat pf = getPrintFormat();
				Window viewer = new SMJReportViewer(getAD_PInstance_ID(), get_TrxName(), PA_ReportLineSet_ID, p_C_Period_ID, pf.getAD_PrintFont_ID(), m_columns);
				viewer.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
				viewer.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT);
				AEnv.showWindow(viewer);
			}
		};
		AEnv.executeAsyncDesktopTask(runnable);

Method 2: Anonymous Runnable

AEnv.executeAsyncDesktopTask(new Runnable() {
        	@Override
			public void run() {
        		 //Window viewer = new SfrReportViewer(ren,"");

                 ReportEngine re = createReportEngine(getProcessInfo(),Env.WINDOW_MAIN,pf);
                 if (p_Org_ID==0)
                	 p_Org_ID = Env.getAD_Org_ID(getCtx());
        		 Window viewer = (Window)new SfrReportViewer(getAD_PInstance_ID(), get_TrxName(), PA_ReportLineSet_ID, p_C_Period_ID, pf.getAD_PrintFont_ID(), m_columns,re,p_Org_ID);
        		 
        		 viewer.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
        	     viewer.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT);
        	     viewer.setAttribute(WindowContainer.DEFER_SET_SELECTED_TAB, Boolean.TRUE);
        	     SessionManager.getAppDesktop().showWindow(viewer);
        	}
        });

Credit: Freddy Heredia

Credits

Initial contribution by: nTier Software Services http://www.ntier.co.za ngordon7000

Add your credit here.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.