No support of waves in FXMLControllers...

25 views
Skip to first unread message

Andreas

unread,
Sep 8, 2015, 5:20:14 AM9/8/15
to JRebirth Users
Hi Seb,

from my understanding, the (FXML)controller is responsible for loading the data for the view/model.

If I have a Master/Details view scenario and want to inform the details about a selection in master list, I would send a wave from Changelistener of master controller (change handler implemented in FXMLController) to the controller of details view.

But in JRebirth, sending/listening waves only available in Model/Service but not in FXMLController(s).

Ok, for sending a wave from controller side, I could do following:

getModel().send(...)

But the listening could be done only in the target model (details model). And from model side I have (if I respect the architecture) no access to the controller.

Why I cannot handle waves in FXML Controllers?

Thanks a lot in advance

Kind regards
Andreas

Sebastien Bordes

unread,
Sep 8, 2015, 5:53:29 AM9/8/15
to jrebirth-users
Hi Andreas,

There is a slight difference between FXMLController and Controller.

Controller are designed to listen events from view and perform action (inside the view or with the rest of the application)

FXMLController can also listen events from the view (so the fxml), but can also grab access on view Nodes (annotation used instead of package getter of View part)


FXMLController and Controller are not JRebirth component, so they can't send or receive Wave (directly), they must rely on the underlying Model.

So when you send a wave from MasterModel to DetailsModel, the DetailsModel shall reload the received data, to do it you can use ((YourFXMLController)DetailsModel.getFXMLController()).update(Data yourData).

The getFXMLController() is available for all classes specializing AbstractFXMLObjectModel.


Seb
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "JRebirth Users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-user...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages