Hi
I have a BarChart with listener that works but when I tried to use the same approach with Gantt Chart, the listener is not working.
I have the following code in the lister:
@Inject
private Chart gantt;
@Inject
private CollectionDatasource<TaskSpan, UUID> taskSpansDs;
@Inject
private Table taskSpanTable;
@Inject
private CollectionDatasource<Segment, UUID> segmentsDs;
@Override
public void init(Map<String, Object> params) {
gantt.addGraphItemClickListener(event -> {
TaskSpan taskSpan = (TaskSpan) event.getItem();
String message = String.format("GDP grow in %s (%s): %.1f%%",
taskSpan.getCategory(),
event.getGraphId().substring(5),
"graph2014".equals(event.getGraphId()) ? taskSpan.getCategory() : taskSpan.getCategory());
showNotification("test message",NotificationType.HUMANIZED);
displayTaskSpan();
});
}
public void displayTaskSpan() {
// Open the products browser as a lookup screen
openLookup("demogantt$TaskSpan.browse",
new Lookup.Handler() {
@Override
public void handleLookup(Collection items) {
}
},
WindowManager.OpenType.THIS_TAB
//ParamsMap.of("customer", getItem().getCustomer()) // Pass Customer to the Products lookup screen
);
}
It seems that GanttChart has this listener but wonder where is something wrong!