getSession().getDispatcher().register(new RequestListener() { public void processRequest(String name, String[] values) { logger.info("remove java script"); frame.removeScriptListener(script); }  public String getName() { return "clear"; } public String getNamePrefix() { return ""; } public void fireIntermediateEvents() {} public void fireFinalEvents() {} });
if (firstTime) {  getSession().getDispatcher().register(new RequestListener() { public void processRequest(String name, String[] values) { logger.info("remove java script"); frame.removeScriptListener(script); }  public String getName() { return "clear"; } public String getNamePrefix() { return ""; } public void fireIntermediateEvents() {} public void fireFinalEvents() {} }); }
    TestFrame showTestFrame() {	if (testFrame == null) {	    testFrame = new TestFrame("test");	    testFrame.setRequestURL(getParentFrame().getRequestURL());	    DynamicCodeResource codeResource = new DynamicCodeResource(testFrame);	    testFrame.addDynamicResource(codeResource);	    PropertyPanel propertyPanel = (PropertyPanel)modules.get("properties");	    // eigentlich sollte man einen property change listener bei der test component	    // registrieren!	    propertyPanel.addActionListener(new ActionListener() {		    public void actionPerformed(ActionEvent event) {			test();		    }		});	}		DynamicCodeResource codeResource = (DynamicCodeResource)testFrame.getDynamicResource(DynamicCodeResource.class);	String url = codeResource.getURL();	if (url.indexOf("?") > -1)	    url = url + "&clear=X";	else	    url = url + "?clear=X";	logger.fine("TEST FRAME URL: " + url);	final ScriptListener script = new JavaScriptListener("onload", "test=window.open('" + url + "', 'test','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300,left=20,top=20');test.focus()");	final SFrame frame = getParentFrame();	frame.addScriptListener(script);	// register a request listener, that handles the named event "clear"	getSession().getDispatcher().register(new RequestListener() {                public void processRequest(String name, String[] values) {                    logger.info("remove java script");                    frame.removeScriptListener(script);                }                public String getName() { return "clear"; }                public String getNamePrefix() { return ""; }                public void fireIntermediateEvents() {}                public void fireFinalEvents() {}            });	return testFrame;    }