Show confirm dialog in Flux architecture

39
June 19, 2017, at 02:29 AM

I'm trying to understand Flux architecture. I'm using JavaFX and the FluxFX experimental framework.

I'm writing a program which allows user to schedule some task at a specific moment ("in 3 hours", "at 10 o'clock", and so on). The point is that only one task must be scheduled at the same time.

When user hits the "schedule" button, an ScheduleAction is dispatched and the scheduled task is stored in the ScheduleStore. Everything OK. When the user tries to schedule a second task, I would like to ask him/her if he/she wants to cancel the previous task. How can I do that? At this moment, I'm using this approach:

  1. Dispatch the ScheduleAction.
  2. The ScheduleStore receives the action and checks if a scheduled task already exists.
  3. If a task already exists, the store push a message into an EventStream (from ReactFX).
  4. The view is observing the EventStream, and shows the message in a confirm dialog (using a JavaFX Alert).
  5. User's response is dispatched in a ResponseAction.

I think this approach "smells bad". What is the correct way to do something like this?

Thank you very much!

READ ALSO
How to Compare a String with a Char

How to Compare a String with a Char

Guys how do i compare a String with a char ? heres my code :

30
What's wrong with my main method, and why is it throwing this exception? [on hold]

What's wrong with my main method, and why is it throwing this exception? [on hold]

I'm a new Java developer, writing my first real Java application, which is a calendar viewerHere's the code I wrote which is indicated as having errors:

61
Need to change the background of a TabbedPane in swing and backgroundColor of a panel

Need to change the background of a TabbedPane in swing and backgroundColor of a panel

Please find the imageI marked one tab which is colored blue

34
Unable to connect ThingSpeak jar files to java program

Unable to connect ThingSpeak jar files to java program

I used ant to build the buildxml file of ThingSpeak and it shows build successful

47