IDEMPIERE-1457 Bug in Calendar - java.lang.NullPointerException
This commit is contained in:
parent
b051da0bef
commit
b72501542e
|
@ -73,13 +73,14 @@ public class Tabpanel extends org.zkoss.zul.Tabpanel implements IdSpace
|
|||
}
|
||||
|
||||
public void onClose() {
|
||||
if (onCloseHandler != null)
|
||||
if (onCloseHandler != null) {
|
||||
onCloseHandler.onClose(this);
|
||||
|
||||
} else {
|
||||
Tab tab = this.getLinkedTab();
|
||||
if (tab != null)
|
||||
tab.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnCloseHandler(ITabOnCloseHandler handler) {
|
||||
this.onCloseHandler = handler;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue