0

I have event dates, titles, venues, attendees, start & end times, location and other metadata collected from users via forms then stored in a mysql database table. I would like to retrieve the events from the database and list them in Google Calender style. So far I only know of JFXtras Agenda having this kind of implementation.

I've been trying for a long time now to work with JFXtras Agenda but I'm stuck at retrieving the events from the database and listing them on the Agenda as Appointments.

How do I go about it? I'm ready to try out any other implementation that lists events from data base like Google Calender does.

Thank you in advance.

Ps.

I think my problem is that I don't understand what an appointment group is from AppointmentGroup Interface (Class Agenda.AppointmentImpl) is supposed to do/ what it is....

From the API: ".......An appointment group is a binding element between appointments; it contains information about visualization....."

What does "binding element between appointments" mean?

ILikeProgramming
  • 293
  • 3
  • 8
  • 23
  • 1
    Did you see https://github.com/JFXtras/jfxtras-ensemble/blob/master/src/ensemble/samples/controls/AgendaSample1.java ? – zella Mar 27 '14 at 05:04
  • Yes I did. I was looking for an implementation that does it by getting items from a database. But the part I'm really not getting is .... **From the API** - ***Interface Agenda.AppointmentGroup***: *"....An appointment group is a binding element between appointments; it contains information about visualization...."* What is an **appointment group**, what does it do? Thank you – ILikeProgramming Mar 27 '14 at 05:57
  • 1
    How i see from sample Appointments with same AppointmentGroup have same color. It's just visual grouping – zella Mar 27 '14 at 06:21

1 Answers1

1

1) Create custom model

public class Event {

    GregorianCalendar startTime;
    GregorianCalendar endTime;
    ...

    public GregorianCalendar getStartTime() {
        return startTime;
    }

    public void setStartTime(GregorianCalendar startTime) {
        this.startTime = startTime;
    }

    public GregorianCalendar getEndTime() {
        return endTime;
    }

    public void setEndTime(GregorianCalendar endTime) {
        this.endTime = endTime;
    }
    ...
}

2) Retrive events from database to List<Event> myEvents

3) Fill your Agenda

Agenda lAgenda = new Agenda();
...
for (Event e : myEvents) {
    lAgenda.appointments().add(
        new Agenda.AppointmentImpl()
        .withStartTime(e.getStartTime())
        .withEndTime(e.getEndTime()));
        ...
}
zella
  • 4,645
  • 6
  • 35
  • 60
  • You don't know just how much you helped, [DarkDarker](http://stackoverflow.com/users/1996639/darkdarker). If I could accept your answer and Up-Vote you 30 times, I could. Thank you so much!!!! – ILikeProgramming Mar 27 '14 at 07:18
  • One last thing please. Could you know how I can add an action Listener so that when an appointment on an agenda is clicked a new window with more details on that particular clicked appointment opens? – ILikeProgramming Mar 27 '14 at 07:56
  • I just added a question on the comment above **[Here:** ***How can I add an action Listener onto an appointment in an agenda (JFXtras Agenda)](http://stackoverflow.com/questions/22681781/how-can-i-add-an-action-listener-onto-an-appointment-in-an-agenda-jfxtras-agend)***. Please take a look if you can. Thanks for the help... – ILikeProgramming Mar 27 '14 at 08:20
  • Sorry for the late reaction; I was not monitoring stackoverflow for issues. Is this still an issue? If so, please file an issue on github. – tbeernot Oct 05 '14 at 12:54