Hello,
I’m creating a sort of time table for classes, and I need to add data from database and a form to a table that shows all the info.
This is my POJO class, schedule
private int id;
private int dayOfWeek;
private LocalTime startTime;
private LocalTime endTime;
This is how I build the table
tbl_schedule.addContainerProperty("id", Integer.class, null);
tbl_schedule.addContainerProperty("dayOfWeek", String.class, null);
tbl_schedule.addContainerProperty("startTime", LocalTime.class, null);
tbl_schedule.addContainerProperty("endTime", LocalTime.class, null);
And this is how I add the new item to the table
Object newId = tbl_schedule.addItem(new Object[] {
schedule.getId(),
schedule.getDayOfWeek(),
schedule.getStartTime(),
schedule.getEndTime()},
null);
That function returns null, so the new item is not being added.
I know I could use a BeanItemContainer but this class has a dependency with another one (my class has one or more schedules) and I don’t know how to handle that.
Also, I want to show the day as a String like sunday, monday etc. I have tried with a custom StringToIntegerConverter, with no result. The table should looks like this:
Day of Week | Start Time | End Time
monday | 9:00 | 11:00
wednesday | 10:00 | 12:00
Any advice?
Thanks