IDEMPIERE-1457 Bug in Calendar - java.lang.NullPointerException

This commit is contained in:
Carlos Ruiz 2013-10-23 10:02:06 -05:00
parent b051da0bef
commit b72501542e
3 changed files with 11 additions and 5 deletions

View File

@ -73,12 +73,13 @@ public class Tabpanel extends org.zkoss.zul.Tabpanel implements IdSpace
}
public void onClose() {
if (onCloseHandler != null)
if (onCloseHandler != null) {
onCloseHandler.onClose(this);
Tab tab = this.getLinkedTab();
if (tab != null)
tab.close();
} else {
Tab tab = this.getLinkedTab();
if (tab != null)
tab.close();
}
}
public void setOnCloseHandler(ITabOnCloseHandler handler) {

View File

@ -66,6 +66,7 @@ import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.Popup;
import org.zkoss.zul.Span;
import org.zkoss.zul.Tab;
import org.zkoss.zul.Timer;
import org.zkoss.zul.Toolbarbutton;
@ -198,6 +199,8 @@ public class CalendarWindow extends Window implements EventListener<Event>, ITab
public void onClose(Tabpanel tabPanel){
//IDEMPIERE-1457: On close, remove calendars away scm
calendars.setModel(null);
Tab tab = tabPanel.getLinkedTab();
tab.close();
}
public void onEvent(Event e) throws Exception {

View File

@ -21,5 +21,7 @@ import org.adempiere.webui.component.Tabpanel;
*
*/
public interface ITabOnCloseHandler {
/* NOTE onClose method must implement the actual closing of the tab */
public void onClose(Tabpanel tabPanel);
}