IDEMPIERE-608 Zk InfoSchedule: Replace TimeLine with Calendar component. Add refresh link.

This commit is contained in:
Heng Sin Low 2013-02-05 07:41:54 +08:00
parent 8d5f668baf
commit 4ad6356508
2 changed files with 16 additions and 5 deletions

View File

@ -121,6 +121,8 @@ public class WSchedule extends Window implements EventListener<Event>
private Component divTabMonth;
private Borderlayout borderlayout;
private Component btnRefresh;
/**
* Static init
@ -145,10 +147,7 @@ public class WSchedule extends Window implements EventListener<Event>
Component tmp = calendarContainer.getFellow("btnSwitchTimeZone");
if (tmp != null)
tmp.detach();
tmp = calendarContainer.getFellow("btnRefresh");
if (tmp != null)
tmp.detach();
tmp.detach();
tmp = calendarContainer.getFellow("lbxRequestTypes");
if (tmp != null)
tmp.getParent().detach();
@ -169,6 +168,9 @@ public class WSchedule extends Window implements EventListener<Event>
btnCurrentDate = (Button) calendarContainer.getFellow("btnCurrentDate");
btnCurrentDate.addEventListener(Events.ON_CLICK, this);
btnRefresh = calendarContainer.getFellow("btnRefresh");
btnRefresh.addEventListener(Events.ON_CLICK, this);
lblDate = (Label) calendarContainer.getFellow("lblDate");
lblDate.addEventListener(Events.ON_CREATE, this);
@ -258,6 +260,8 @@ public class WSchedule extends Window implements EventListener<Event>
if (type.equals(Events.ON_CLICK)) {
if (event.getTarget() == btnCurrentDate) {
btnCurrentDateClicked();
} else if (event.getTarget() == btnRefresh) {
updateModel();
}
} else if (type.equals(Events.ON_CREATE)) {
if (event.getTarget() == lblDate)
@ -332,4 +336,11 @@ public class WSchedule extends Window implements EventListener<Event>
borderlayout.appendChild(south);
}
}
public void removeRefreshButton() {
if (btnRefresh != null) {
btnRefresh.detach();
btnRefresh = null;
}
}
} // WSchedule

View File

@ -155,7 +155,6 @@ public class InfoSchedule extends Window implements EventListener<Event>
{
log.log(Level.SEVERE, "InfoSchedule", ex);
}
// AEnv.showWindow(this);
displayCalendar();
} // InfoSchedule
@ -225,6 +224,7 @@ public class InfoSchedule extends Window implements EventListener<Event>
schedulePane.addEventListener(CalendarsEvent.ON_EVENT_CREATE, this);
schedulePane.addEventListener(CalendarsEvent.ON_EVENT_EDIT, this);
schedulePane.addEventListener(CalendarsEvent.ON_EVENT_UPDATE, this);
schedulePane.removeRefreshButton();
}
else
{