If you maximize a porlet you cannot close it via removePortlet( porlet ).
workaround, unmaximize it and then close it.
What is the proper way to close a portlet programmatically? I'm trying to do it via a CloseClickHandler:
Version: SmartGwt2.4
Browser: Firefox on MacOSX
workaround, unmaximize it and then close it.
What is the proper way to close a portlet programmatically? I'm trying to do it via a CloseClickHandler:
Code:
addCloseClickHandler(new CloseClickHandler() { @Override public void onCloseClick(CloseClientEvent closeClientEvent) { if( pass.isDirty() ) { // we need this just in case the user changed the title field which is used in the confirm dlg below try { pass.bind(); } catch (InvalidPassInterfaceException e) { /*swallow*/} SC.confirm("<B>Changes will be lost.</B><br/>Click \"Ok\" to close Pass: " + pass.getField("pass.number").getValue() + " v" + pass.getField("pass.version").getValue() + "<br/><br/>Title: " + pass.getField("project.title").getValue(), new BooleanCallback() { @Override public void execute(Boolean ok) { if (ok) Dashboard.getInstance().removePortlet(PassPortlet.this); } }); } else { Dashboard.getInstance().removePortlet(PassPortlet.this); } } });
Browser: Firefox on MacOSX
Comment